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 Apr 12, 2024. It is now read-only.
actually it turns out that ISO8601 states that if a timezone is not specified the time/date is in the local time, so {{ '2012-04-01 0:0:0' | date:'d MMM yyyy' }} should always render as 1 Apr 2012.
The odd thing is the javascript's Date constructor is quite screwed up (at least in V8):
> new Date('2012-04-01')
Sat Mar 31 2012 17:00:00 GMT-0700 (PDT)
> new Date('2012-04-01T00:00:00')
Sat Mar 31 2012 17:00:00 GMT-0700 (PDT)
> new Date('2012-04-01 0:0:0')
Sun Apr 01 2012 00:00:00 GMT-0700 (PDT)
> new Date('2012-04-01 00:00:00')
Sun Apr 01 2012 00:00:00 GMT-0700 (PDT)
> new Date('2012-04-01T00:00:00Z')
Sat Mar 31 2012 17:00:00 GMT-0700 (PDT)
> new Date('2012-04-01 00:00:00Z')
Sat Mar 31 2012 17:00:00 GMT-0700 (PDT)
notice that in some cases when the timezone is not specified the date/time is parsed as local, other times its parsed as UTC.
previously we were always parsing the string input as UTC which cased issues like:
{{ '2012-04-01' | date:'d MMM yyyy' }} renders as 31 Mar 2012
BREAKING CHANGE: string input without timezone info is now parsed as local time/date
Closesangular#847
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
{{ '2012-04-01' | date:'d MMM yyyy' }}
renders as31 Mar 2012
http://plnkr.co/edit/pdoczJeLZoCo6CRuwUWi?p=preview
this issue only occurs for clients in timezones before GMT (like PT for example)
The text was updated successfully, but these errors were encountered: