-
Notifications
You must be signed in to change notification settings - Fork 604
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
Date: Olson-timezone-support (real 'z', 'v', 'V') and options.timeZone #701
Conversation
The below is wrong, it should use "British Summer Time" name instead. Globalize('en-GB').formatDate(new Date(2017,8,1), {datetime: 'full', timeZone: 'Europe/London'})
'Friday, 1 September 2017 at 04:00:00 GMT+01:00' Edit: this has been fixed. |
7cb9891
to
c82a6d0
Compare
To quickly demo what's coming... I hope you like it!
var Globalize = require( "globalize" );
Globalize.load( require( "cldr-data" ).entireSupplemental() );
Globalize.load( require( "cldr-data" ).entireMainFor( "en" ) );
Globalize.loadIANATimezone( require( "iana-tz-data" ) );
Globalize( "en" ).formatDate(new Date(), {datetime: "short", timeZone: "America/Los_Angeles"});
// > '3/19/17, 3:19 PM'
Globalize( "en" ).formatDate(new Date(), {datetime: "short", timeZone: "America/New_York"});
// > '3/19/17, 6:19 PM'
Globalize( "en" ).formatDate(new Date(), {datetime: "short", timeZone: "America/Sao_Paulo"});
// > '3/19/17, 7:19 PM'
Globalize( "en" ).formatDate(new Date(), {datetime: "short", timeZone: "Europe/Berlin"});
// > '3/19/17, 11:19 PM'
Globalize( "en" ).formatDate(new Date(), {datetime: "full", timeZone: "America/Los_Angeles"});
// > 'Sunday, March 19, 2017 at 3:19:22 PM Pacific Daylight Time'
Globalize( "en" ).formatDate(new Date(), {datetime: "full", timeZone: "America/New_York"});
// > 'Sunday, March 19, 2017 at 6:19:22 PM Eastern Daylight Time'
Globalize( "en" ).formatDate(new Date(), {datetime: "full", timeZone: "America/Sao_Paulo"});
// > 'Sunday, March 19, 2017 at 7:19:22 PM Brasilia Standard Time'
Globalize( "en" ).formatDate(new Date(), {datetime: "full", timeZone: "Europe/Berlin"});
// > 'Sunday, March 19, 2017 at 11:19:53 PM Central European Standard Time' |
@rxaviers I LOVE YOU. We need this. |
Importing work from globalizejs/globalize#701
Importing work from globalizejs/globalize#701
Importing work from globalizejs/globalize#701
Importing work from globalizejs/globalize#701
Imported from globalizejs/globalize#701
5ba59fe
to
e3d4838
Compare
Any updates on this? We need to add support for timezones in the next few weeks. |
Hi @mattyork, we should have a 1.3.0 soon. About the issue above, Thanks for reporting it. |
For the record, the fix for the dateFormatter runtime issue is here: #724 |
Rebased and squashed |
Merged 🕺 |
Checklist:
options.timeZone
options.timeZone
options.timeZone
Notes:
z
,v
,V
and more) #340