angular: DatePipe doesn't allow timezone to be provided as a pipe input

DatePipe of Angular 2.0.0 RC2 doesn’t allow to interpret date with timezone like AngularJS 1.5 does (https://docs.angularjs.org/api/ng/filter/date) as the second argument (timezone)

Angular 1 template api:

{{ date_expression | date : format : timezone}}

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 12
  • Comments: 25 (10 by maintainers)

Commits related to this issue

Most upvoted comments

yes

Hello, the timezone option as a third argument of the date pipe will be added with the PR to replace the intl API for angular v5 (see https://github.com/angular/angular/issues/10809)

@MarkPieszak z and Z are used in the format to display the timezone, not as the interpreter! Please read the doc of angularJS (link in the question)

Sorry for my limited knowledge, what values can timezone variable take? I’m working with angular 5 I mean can I use it this way : {{ test?.end_datetime | date : “h:mm a” : “CET” }} Thanks

+1 for @natcohen suggestion to include this in upcoming features.