logbon72 / angular-material-datetimepicker

Datepicker for Angular Material, mimick's Android's date time picker
https://logbon72.github.io/angular-material-datetimepicker
MIT License
169 stars 123 forks source link

Problem using "DD/MM/YYYY" format #41

Closed ngarrard closed 7 years ago

ngarrard commented 8 years ago

When specifying "DD/MM/YYYY" as format, the datetimepickers date becomes invalid and shows an empty input. The value I use as date = "2016-05-23T11:20:21.7329621+02:00"

My findings: Setting the format at line 115: scope.currentDate = moment(scope.currentDate, scope.format); in angular-material-datetimepicker.js, the m.isValid() at line 125 returns false.

ceetee commented 8 years ago

I was able to get formatting working correctly by changing line 115 to scope.currentDate = moment(scope.currentDate).format(scope.format);

logbon72 commented 7 years ago