diosney / angular-bootstrap-datetimepicker-directive

A wrapper directive around the bootstrap-datetimepicker component.
MIT License
69 stars 50 forks source link

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

Open razyalov opened 9 years ago

razyalov commented 9 years ago

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.

SamiSammour commented 8 years ago

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