feat(DATE): Add Temporal Adapter
Feature Description
The Temporal API has been almost done for a year now.
Extract from README.MD:
NOTE: Although this proposal's API is not expected to change, implementers of this proposal MUST NOT ship unflagged Temporal implementations until IETF standardizes timezone/calendar string serialization formats. See https://github.com/tc39/proposal-temporal/issues/1450 for updates.
Use Case
If the adapter were created, people could start to experiment with this. Also, the could be THE final adapter to exist. (If temporal lives to meet expectation)
This could be solved by adding an adapter method getMonthList that would return a readonly array of length 12.
---------- Original e-mail ---------- I just tried to implement based on the polyfill.
Unfortunately I am running into an issue because the calendar view expects the month to start at 0 ...
See: https://github.com/angular/components/blob/main/src/material/datepicker/month-view.ts#L403C1-L404C1
Since with Temporal the month starts with 1 we can not use index based usage of the month names. I tried working around this by adding a dummy object into the array. But then the month view gets broken...
Another issue is here: https://github.com/angular/components/blob/main/src/material/datepicker/year-view.ts#L306
Using fixed months array results in trying to create a month 0 which is no possible with Temporal
Demo: https://stackblitz-starters-g4yw3h.stackblitz.io
This could be solved by adding an adapter method
getMonthListthat would return a readonly array of length 12
Also considering the different calendar options, this might be a better solution (not every calendar has 12 months)
I also was able to implement it by adding or substracting the month where I had to:
Anything planned here?
Temporal is currently supported as a TP in Firefox and Safari (not fully). Seems like it will soon hit all major browsers.
A Temporal date adapter would be nice to have.
https://developer.mozilla.org/en-US/blog/javascript-temporal-is-coming/
Temporal is already supported by Firefox. Also there is a polyfill for it https://www.npmjs.com/package/@js-temporal/polyfill. Can you revise the priority, please?