Material: md-datepicker displays current date and cannot be blank initially on IE11, firefox, Edge

Created on 30 Nov 2016  路  5Comments  路  Source: angular/material

Actual Behavior:

  • What is the issue? *md-datepicker displays current date and cannot be blank initially on IE11, firefox, Microsoft Edge. And I cannot set empty value initially because it results in 'Invalid Date'.
  • What is the expected behavior?
    I think md-datepicker is expected to show empty if no value is set, like it behaves in Chrome.

CodePen (or steps to reproduce the issue): *

  • CodePen Demo which shows your issue:
  • Details: Using md-datepicker tag with ng-model and no value set in JavaScript.
    If I set value using angular.element, it displays empty value but I think it's not good practice.

Angular Versions: *

  • Angular Version: 1.5
  • Angular Material Version: 1.1.1

Additional Information:

  • Browser Type: * IE11, firefox, Edge
  • Browser Version: *
  • OS: *Windows
  • Stack Traces:

Shortcut to create a new CodePen Demo.
Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.

demo

All 5 comments

+1

Please create a Codepen demo using the link in the issue so we can investigate.

@kumakumagai , are you using a custom format function? (application-wide or locally)
Sometimes it is where this problem comes from and may be very tricky to find out. Check this issue: #8493
https://github.com/angular/material/issues/8493

@rcpalacio
Yes, I'm using moment.js to format date application-wide and that seems to be causing this problem.
Solution on #8493 solved this problem.
Thanks a lot!

Im using moment.js to format.
https://github.com/angular/material/issues/8493
Worked for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeoLozes picture LeoLozes  路  3Comments

robertmesserle picture robertmesserle  路  3Comments

epelc picture epelc  路  3Comments

chriseyhorn picture chriseyhorn  路  3Comments

PeerInfinity picture PeerInfinity  路  3Comments