-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Datepicker malfunctioning in Firefox: fails to update the model when manually updating the date #3159
Comments
Anything I can do to help more? |
Changing to fixes it. It seems that it is a date editor, not a datetime editor. One issue (related?) in doing this is you'll find dates are internally expressed as datetimes at midnight local timezone. Remote the format filter in your display to see how it looks |
@darkbls I assume this was with Angular 1.3? |
Transferred to Plunker for working version. I will investigate. |
Interestingly, this might have to do with how the browsers interpret dates. The object set in the view for both Chrome and Firefox is a date when the user clicks on the date. When the user deletes a character, say from This new Plunker illustrates this. In this case, Firefox's behavior looks to be more strict than Chrome's. It turns out that Safari also agrees with Firefox here, and Chrome is the outlier. I will investigate how IE behaves, but I believe that Chrome's behavior is actually the strange one here. I am not sure we should support this behavior. |
Not sure if it helps but, this format works in FF. Not entirely sure why $scope.format = 'MM/dd/yyyy HH:mm:ss'; Also FWIW I think it should be fixed. Not sure what to do about new Date('2015-03-1 00:00:00), but seems like once you type in a valid date, ie add a 7 to the end new Date('2015-03-17 00:00:00) the input should re-validate to a correct date, but it doesn't. I will look into it more to see what else I can find. |
Well, that sort of makes sense - the string in the input does not match the format expected otherwise. Maybe changing the $formatter so that it displays the date in the expected format would fix this issue. |
I think I've identified the cause - the date parser cannot recognize the |
Single quotes at the end of a date format fix the date typing issue in Firefox. |
Thanks Lux90, we had a similar issue and through your solution it worked in Firefox as of now. But just curious to know what is the logic behind putting a string inside a string. Maybe date object manipulation in firefox and now it's validating string instead of date object? |
Manually changing the date value, after the it was inserted, fails to update the model on Firefox.
It seems to deletes the content (?).
Check the fiddle for a proper example, open it on chrome and firefox.
http://jsfiddle.net/HB7LU/9779/
The text was updated successfully, but these errors were encountered: