Consider date formatting

Michael Kriegel michael.kriegel at actifsource.com
Thu Sep 21 07:01:45 UTC 2017


Okay, this is still draft, I did not see it. It is very powerful, yet it 
makes it more complicated. The format strings, which are widely known 
and used would be handy to have in addition. However, if "they" decide, 
not to have them, I can still decide to use formatToParts or a library.


On 21.09.2017 08:56, kdex wrote:
> You can build custom formats with
> `Intl.DateTimeFormat.prototype.formatToParts`.
>
> Combine these results with template literals; isn't that enough?
>
> On Thursday, September 21, 2017 8:52:10 AM CEST Michael Kriegel wrote:
>> You cannot set an arbitrary format. From a UI point of view it is great
>> to format it "localized", but if you have strict requirements in your
>> projects, then you have to build it up yourself or use a library. So I
>> do not see, how to use Intl.DateTimeFormat for custom format strings.
>>
>> On 21.09.2017 08:45, kdex wrote:
>>> So what's wrong with Intl.DateTimeFormat?
>>>
>>> On Thursday, September 21, 2017 8:41:33 AM CEST Michael Kriegel wrote:
>>>> I would like to suggest to take up date formatting into the standard.
>>>> Either as optional format parameter on Date.prototype.toDateString() or
>>>> as a separate method Date.prototype.toFormattedDateString(format).
>>>>
>>>> format should be a string in the form as specified in
>>>> https://tc39.github.io/ecma262/#sec-date-time-string-format
>>>>
>>>> I know there are libraries for that, but I think it is fundamental
>>>> enough to put it into the standard instead.
>>>>
>>>> I hope this was not already discussed before and I just did not find the
>>>> thread.
>>>>
>>>>
>>>> _______________________________________________
>>>> es-discuss mailing list
>>>> es-discuss at mozilla.org
>>>> https://mail.mozilla.org/listinfo/es-discuss
>>>>
>>>>
>>>> _______________________________________________
>>>> es-discuss mailing list
>>>> es-discuss at mozilla.org
>>>> https://mail.mozilla.org/listinfo/es-discuss

-- 
Michael Kriegel • Head of R&D • Actifsource AG • Haldenstrasse 1 • CH-6340 Baar • www.actifsource.com • +41 56 250 40 02

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170921/fddd742e/attachment-0001.html>


More information about the es-discuss mailing list