0

I've added jquery's datetimepicker in my html form, when I'm clicking on input box it opens datetimepicker calender and populate input box with current date and time, which is fine. But if I'm selecting any future date, the timebar's hour and minutes is still remain to current time i.e I'm not able to select any time less than current time in case of future date selection, more importantly this problem does not occur regularly and some time it is working fine(i'm also using angularjs), below is the code i'm using

<input ng-show="sentMsgStatus" id="datepickerEnd" name="endDateTime"
 readonly="readonly" value="{{msgEndDate | date:'dd/MM/yyyy H:mm'}}" 
 ng-model="msgEndDate"/>

$("#datepickerEnd").datetimepicker({dateFormat: "dd/mm/yy",timeFormat: 'hh:mm',
  minDate: new Date()});
Mark Rajcok
  • 362,217
  • 114
  • 495
  • 492
  • please select your code part of the question and press `ctrl+k` to format the code – Dakait Feb 26 '13 at 09:49
  • Can you provide a jsfiddle or plunker? I believe your problem is related to trying to use the value attribute. Angular ignores that attribute (except for radio buttons). I think you'll need a directive with a custom formatter. See http://stackoverflow.com/a/12947995/215945 for an example. – Mark Rajcok Feb 26 '13 at 15:37
  • Thanks Mark for reply, This is a long page so, it is difficult to write js fiddle, – Ranvijay Singh Feb 28 '13 at 03:43
  • I'm using jquery datetimepicker here which allow to select time, so you mean to say due to value attribute, timepicker's time is not updated properly, if this is the case then why this problem is not occur regularly. – Ranvijay Singh Feb 28 '13 at 03:53

0 Answers0