-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow UTC format in configuration #460
Comments
Update Now you could
|
Thanks a lot! |
I want to display a UTC+0 date received from the server, however when I open the owlDateTimePicker it translates the date to my current timezone: UTC+2, and shows the day before! I've added the provider you link to, and the owlDateTimePicker picks dates in UTC+0 correctly, however when reading UTC+0 dates it converts it to UTC+2. I've even tried setting: Examples with screenshots are below |
@PeterOeClausen I'm having the same issue, only with UTC-7. I have yet to fine a solution, hopefully @DanielYKPan can chime in on this. A workaround that seems to fix it is just appending your local UTC offset to the date. In my case It's really hacky, but as of right now I don't see any other way. |
Hey @DanielYKPan , How can I use this in conjunction with custom formats? I have tried this but it does not work:
|
@NgModule({ |
Hello,
The moment adapter by @angular/material-moment-adapter offers a very convenient way of parsing all dates as UTC:
@NgModule({ imports: [MatDatepickerModule, MatMomentDateModule], providers: [ { provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } } ] })
See: https://github.com/angular/material2/blob/master/src/material-moment-adapter/adapter/moment-date-adapter.ts
Would you consider adding a similar option to this library? It would save me a lot of trouble ensuring consistency between locale and UTC dates.
Thanks a lot,
The text was updated successfully, but these errors were encountered: