Open ScreamZ opened 6 years ago
Maybe this is your apollo-client
who needs to have the right locale.
@kl3sk : Seems that is not possible to configure on apollo-client
.
What I've done atm is:
Mon Aug 13 2018 00:00:00 GMT+0200 (Central European Summer Time)
format.apollo-client
auto-convert it to UTC ISO8601
.const localizedDate = moment(session.date);
Looks good, but I think the documentation would require a bit of light on this ?
Best regards
PS: @nathanreyes I ping you on this, just in case you have some time to share with us about that ;)
Having the same issue parsing a date. Some information in the docs would be appreciated.
@ScreamZ Thanks for the well-written explanation. Just to be clear when you pass the session.date
into v-date-picker
, this is a string in ISO 8601 format?
EDIT: Ok, please disregard that. I think I did not understand your issue.
Question: When the client fetches the date from your web service, how were you providing this date value back to v-date-picker
? What code were you using, before using moment.
Hello, first I would like to thank you for this great library. I love it so much.
I think this is a pretty common issue, but I'm starting playing with date and locales :'(
Problem
If I'm posting today it's because I'm encountering an issue with
apollo-client
my GraphQL client library.I'm using the DatePicker component with
single
mode, I'm currently in France and when I click a day it returns me the following value :Mon Aug 13 2018 00:00:00 GMT+0200 (Central European Summer Time)
apollo-client
convert it to2018-08-12T22:00:00.000Z
before sending it to my backend. This is a standard 8601 conversion (ES2015 specification).Result: When my backend receive and store the data. It is the day before. When I fetch back the data, there is no more localization because I'm getting the UTC ISO 8601 string.
So i'm highlighting the day before instead of the one I clicked.
Questions
Here come my two questions:
Thanks for your help… Best regards.
Andréas