You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.
I have an attribute as date_started: DS.attr('date'),
In my template, I have this: {{bootstrap-datepicker value=model.date_started class="form-control" todayBtn='linked' required=true}}
So far so good, the datepicker opens, I select for example 31/12/2016 (dd/mm/yyyy) and the binded input has the correct date on it.
This is what I see on the console: Sat Dec 31 2016 00:00:00 GMT+0100 (CET)
But, when I save() the model, the output payload is this: "date-started"=>2016-12-30T23:00:00.000Z, this is one day behind
Ember: 2.10.1
Ember Data: 2.10.0
jQuery: 3.1.1
ember-cli-bootstrap-datepicker: 0.5.6
I'm using JSONAPI, and no custom serializers.
If I understand correctly, this addon uses Date Javascript Object, and Ember also use it when adding the 'date' name.
What I'm doing wrong? I've read here in some issues that you have to use computed propertys, getters/setters, but only in the case you want a string format, but not if you're using the custom Date js object.
I'm aware about the js dates and utc conversions, but surely this is a common scenario with a common solution ...
thanks,
The text was updated successfully, but these errors were encountered:
I have an attribute as
date_started: DS.attr('date'),
In my template, I have this:
{{bootstrap-datepicker value=model.date_started class="form-control" todayBtn='linked' required=true}}
So far so good, the datepicker opens, I select for example 31/12/2016 (dd/mm/yyyy) and the binded input has the correct date on it.
This is what I see on the console:
Sat Dec 31 2016 00:00:00 GMT+0100 (CET)
But, when I save() the model, the output payload is this:
"date-started"=>2016-12-30T23:00:00.000Z
, this is one day behindEmber: 2.10.1
Ember Data: 2.10.0
jQuery: 3.1.1
ember-cli-bootstrap-datepicker: 0.5.6
I'm using JSONAPI, and no custom serializers.
If I understand correctly, this addon uses Date Javascript Object, and Ember also use it when adding the 'date' name.
What I'm doing wrong? I've read here in some issues that you have to use computed propertys, getters/setters, but only in the case you want a string format, but not if you're using the custom Date js object.
I'm aware about the js dates and utc conversions, but surely this is a common scenario with a common solution ...
thanks,
The text was updated successfully, but these errors were encountered: