ember-cli-bootstrap-datepicker
ember-cli-bootstrap-datepicker copied to clipboard
Bind a date to Ember CLI datepicker
I would like to bind the following date to a date picker. Any idea? Thanks.
date value: 2014-12-31T00:00:00
html: {{bootstrap-datepicker autoclose=true value=model.date format="yyyy/mm/dd" class="form-control" placeholder="Select a date" clearBtn=true todayHighlight=true}}
And what's the problem? If value
is an Date
object everything should be fine.
@lewis-mhi all you need to to do is convert you ISO8601 string into a Date object.
Date object can parse ISO8601 date representation correctly. However you need to keep in mind that it uses your local timezone.
Example:
new Date('2014-12-31T00:00:00') // => Wed Dec 31 2014 01:00:00 GMT+0100 (CET)