EnsembleUI / ensemble

Build native apps 20x faster than Flutter, RN or any other tech
https://ensembleui.com/
BSD 3-Clause "New" or "Revised" License
124 stars 15 forks source link

Support `format` property on Date #1592

Open evshi opened 2 months ago

evshi commented 2 months ago

It is fairly common for apps to conform to a single date display format that may differ from the default for input and display. In ensemble react we have uses cases for supporting additional date display formats from the default. Under the hood we use day.js (successor to moment.js) which has a fairly robust format specification. I think we can start with a subset of these to start, e.g. MM/DD/YYYY

Additional context: date format specification https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat

kmahmood74 commented 2 months ago

@evshi please specify which format methods (or js library) we should be supporting? Currently, we support all js Date methods but they have limited formatting options. If we just take a format as a string and support that, is that enough?

evshi commented 2 months ago

Updated with more details. I think taking a subset of the day.js format specification would be enough.