mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.52k stars 1.31k forks source link

[pickers] Add Temporal to date-librairies #4399

Open MarinePicaut opened 3 years ago

MarinePicaut commented 3 years ago

It would be great to add the Temporal API as a part of date-librairies to the Date / Time pickers component

Summary 💡

It should work same as the others date-librairies supported by the component.

Examples 🌈

Same as here

Motivation 🔦

[Temporal](https://github.com/tc39/proposal-temporal is the future, currently stage 3

eps1lon commented 3 years ago

You can use any date library you want as long as it implements the required interface of LocalizationProvider#dateAdapter.

So you can already use the Temporal API. This is for now the better approach since we don't want to maintain an implementation relying on experimental APIs. Once it becomes stable we can include the implementation in the lab.

remy90 commented 2 years ago

This proposal is now in the hands of ECMAScript engine implementers, so the bar for making API changes is extremely high - https://github.com/tc39/proposal-temporal/tree/main/#polyfill

I'm also interested in using the Temporal API polyfill. Has anyone tried implementing the dateAdapter interface?

remy90 commented 2 years ago

I've been hacking away at an interface implementation for MuiPickersAdapter. Has anyone got any ideas for implementing getFormatHelperText?

remy90 commented 2 years ago

Unfortunately, I've run out of time on this one, if anyone fancies picking up my hack where I'm leaving it: https://gist.github.com/remy90/46920c3496def037992ffd1d1d70eaa2#file-temporaldateadapter-txt