Skip to content
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

docs(datepicker): add a guide on creating custom date adapters #19044

Open
airasyaqub opened this issue Apr 10, 2020 · 1 comment
Open

docs(datepicker): add a guide on creating custom date adapters #19044

airasyaqub opened this issue Apr 10, 2020 · 1 comment
Labels
area: material/datepicker docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@airasyaqub
Copy link

I want to use my own timezone for selected dates in mat date picker. After researching my best option was to write my own parser to use my desired time zone in adapter. Currently the parser only runs when I input in field whereas it should also run when selecting date from toggle box. There are currently many threads on different platform with similar requirements. Kindly update your angular docs with suitable example or give us the example up here to provide timezone on mat date picker.

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-edvxsk

Steps to reproduce:

  1. select date
  2. log in the parser function in custom adapter

Expected Behavior

Parser function should also run when selecting date from toggle box.

Actual Behavior

Parser only runs when I input in field

@airasyaqub airasyaqub added the needs triage This issue needs to be triaged by the team label Apr 10, 2020
@mmalerba
Copy link
Contributor

The parse method is used to convert text the user types to a date, you also need to override the createDate which is used to create dates given the year, month, and date.

I think we should have a guide on creating custom date adapters, I'll use this issue to track that

@mmalerba mmalerba added area: material/datepicker docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels May 29, 2020
@mmalerba mmalerba changed the title bug([DATEPICKER]): [TIME-ZONE IN MOMENT DATE PICKER ] docs(datepicker): add a guide on creating custom date adapters May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/datepicker docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

2 participants