angular-bootstrap-datetimepicker-directive icon indicating copy to clipboard operation
angular-bootstrap-datetimepicker-directive copied to clipboard

should use $modelValue instead of $viewValue in setPickerValue()

Open razyalov opened this issue 10 years ago • 1 comments

There is a bug that causes the datetimepicker to parse dates wrong (e.g. '2015-10-07T13:00:00Z' is parsed as July 10th instead of October 7th) because the setPickerValue() is using the ngModelCtrl.$viewValue instead of ngModelCtrl.$modelValue.

This causes the picker to lose the moment object and instead set it to a locale based string format of the original date that is then parsed wrongly.

razyalov avatar Oct 07 '15 22:10 razyalov

I have the same issue, when you initialize the model with a date variable it doesn't set the datepicker value, but if you take it from the $modelValue it works fine

SamiSammour avatar Nov 22 '15 10:11 SamiSammour