Open xentec opened 9 months ago
Right now, it is possible to do that using a pure callback
in a global object, and implement the time formatting in native code.
But yes, we should support local-aware time formatting somehow through @tr("...")
in the future
Alternatively, would it perhaps make sense to provide time formatting independent from @tr
and insteadas a built-in functionality that uses icu4x behind the scenes?
I often display lists with dated items and filter them in UI logic to avoid updating the whole list over and over again. The date values themselves are simple
int
s in seconds. But to display said dates I also need to format a string inside the app logic and send it to the UI. This seems redundant. Since formatting the data should be an UI job, I'd like to request new feature: time (and date) formatting.It could be a simple macro like:
@fmt-time(time, "<strftime>")
1 or a newtime
type with aWindow.default-time-format
property and localization integration.