angular / angular/components

Add docs example of custom timezone with MomentDateAdapter

Offen
#8,482 7 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: docs area: material/datepicker help wanted P5
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

#### Bug, feature request, or proposal:
[X] Feature Request

#### What is the expected behavior?
MomentDateAdapter should have timezone support.
Moment has a timezone lib (http://momentjs.com/timezone/) which you can set the timezone
manually. This is needed when you want to create a common date/datetime based in a specific timezone.

#### What is the current behavior?
MomentDateAdapter supports browser's timezone only when creating a new date moment object.

#### What are the steps to reproduce?
* Include MatMomentDateModule to use MomentDateAdapter
* Create a mat-datepicker
* Console the output (date generated)

#### What is the use-case or motivation for changing an existing behavior?
I do want to create a common date/datetime based in a specific timezone.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular CLI: 1.5.0
Node: 8.8.1
OS: darwin x64
Angular: 5.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

`@angular/cdk: 5.0.0-rc0`
`@angular/cli: 1.5.0`
`@angular/flex-layout: 2.0.0-beta.10-4905443`
`@angular/material-moment-adapter: 5.0.0-rc0`
`@angular/material: 5.0.0-rc0`
`@angular-devkit/build-optimizer: 0.0.32`
`@angular-devkit/core: 0.0.20`
`@angular-devkit/schematics: 0.0.34`
`@ngtools/json-schema: 1.1.0`
`@ngtools/webpack: 1.8.0`
`@schematics/angular: 0.1.2`
`typescript: 2.4.2`
`webpack-sources: 1.0.1`
`webpack: 3.8.1`

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die aktuelle Dokumentation zu MatMomentDateModule und MomentDateAdapter zu lesen, und prüfe anschließend das im Issue beschriebene Zeitzonenszenario. Füge ein Dokumentationsbeispiel hinzu, das zeigt, wie ein Datum oder eine Datums-/Uhrzeitangabe für eine manuell ausgewählte Zeitzone erstellt wird, und bestätige, dass das Beispiel dem aktuellen Verhalten des Adapters entspricht.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.