Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(filter): format timezone correctly #9534

Closed
wants to merge 2 commits into from
Closed

fix(filter): format timezone correctly #9534

wants to merge 2 commits into from

Conversation

shahata
Copy link
Contributor

@shahata shahata commented Oct 10, 2014

This fixes timezone formatting in case UTC timezone is used

Closes #9359

This fixes timezone formatting in case UTC timezone is used

Closes #9359
@@ -471,7 +476,7 @@ function dateFilter($locale) {
}
forEach(parts, function(value){
fn = DATE_FORMATS[value];
text += fn ? fn(date, $locale.DATETIME_FORMATS)
text += fn ? fn(date, $locale.DATETIME_FORMATS, timezone)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems really hackish to me, any suggestions?

@shahata
Copy link
Contributor Author

shahata commented Oct 10, 2014

I added another commit here for supporting conversion to timezone other than UTC because it bothered me... Is this something we want?

var offset = date.getTimezoneOffset();
if (timezone) {
var zone = Date.parse('1970-01-01 00:00:00 ' + timezone) / 60000;
if (zone === zone) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zone === zone ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid Date -> NaN

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you prefer we throw on invalid timezone?

@IgorMinar IgorMinar modified the milestones: 1.3.0-rc.6, 1.3.0 Oct 13, 2014
@tbosch tbosch modified the milestones: 1.3.x, 1.3.1, Backlog Oct 15, 2014
@shahata
Copy link
Contributor Author

shahata commented Jan 24, 2015

closing in favor of #10858 and #10857

@shahata shahata closed this Jan 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dateFilter uses locale timezone offset for "Z" even when UTC timezone is specified
5 participants