ember-cli-bootstrap-datepicker icon indicating copy to clipboard operation
ember-cli-bootstrap-datepicker copied to clipboard

Add support for iso date string values

Open maladon opened this issue 9 years ago • 3 comments

Allow incoming date values to be ISO formatted dates that can be parsed automagically by JS.

maladon avatar Aug 31 '15 19:08 maladon

Hey @maladon! Thank you for your help :+1:

ISO formatted dates could cause some weird issues because JS converts dates into local time, e.g. you pass 2014-10-17T00:00:00, but depending on your time zone it might be converted into 2014-10-16 (one day behind). You could see more details in https://github.com/soulim/ember-cli-bootstrap-datepicker/issues/18.

So I would like to know what was the reason for changes in this pull request. Do you have some issues with native JS dates?

soulim avatar Sep 01 '15 14:09 soulim

Our back end services all return ISO formatted dates, and since we're not using ember data we just put the response JSON in our models. That means that our "dates" are really just strings in ISO format. This change allows those strings to work with the bootstrap datepicker.

maladon avatar Sep 01 '15 14:09 maladon

@maladon Why don't you use computed properties? Also have a look at #42.

jelhan avatar Nov 18 '15 12:11 jelhan