material icon indicating copy to clipboard operation
material copied to clipboard

Datepicker formats supported

Open slimovic opened this issue 10 years ago • 3 comments

Hello,

Based on the Datepicker demo I found an issue by entering a date manually.

Those formats are supported:

  • dd/mm/yyyy
  • dd-mm-yyyy
  • yyyy/mm/dd

This format is not supported(it reduce one day in the model, the time zone is correct, See screenshots)

  • yyyy-mm-dd

1. Screenshot 1

2016_06_02_10_34_48_settings

2. Screenshot 2 2016-06-02 10_36_55-basic usage

Thank you.

slimovic avatar Jun 02 '16 14:06 slimovic

This problem is related to JavaScript Date.parse

A helpful link.

slimovic avatar Jun 02 '16 15:06 slimovic

This issue happens when your browser time zone is GMT-X. Im in north America, I have GMT-0400, for the example in the screenshot(2016-06-02), javaScript will handle that as Wed Jun 01 2016 20:00:00 GMT-0400 (Eastern Daylight Time), for this reason it shows in the calendar is June first.

Any luck to make datepicker handle that?

P.S: This date format(yyyy-mm-dd) is ISO 8601

slimovic avatar Jun 03 '16 15:06 slimovic

You are welcome to submit a PR to enhance the current datePicker. We can reopen this issue at that time. Otherwise this feature will be relegated to ngM2.

ThomasBurleson avatar Jun 04 '16 21:06 ThomasBurleson