Sarthak Sanghavi Sarthak Sanghavi - 7 months ago 47
AngularJS Question

Error in date format in angularjs

<input type='time' class='form-control' value='{{Doctor.Open_time_to | date:"HH:mm:ss"}}' data-ng-model='Doctor.Open_time_to' required>

At this place is is giveing an exception that

does not conform to the required format. The format is "HH:mm", "HH:mm:ss" or "HH:mm:ss.SSS" where HH is 00-23, mm is 00-59, ss is 00-59, and SSS is 000-999.


Your model need to be a Date object, so Use this

$scope.your_date_model = new Date(your_date_variable);