Re: Consider date formatting

2017-09-22 Thread Caridy PatiƱo
Intl.DateTimeFormat is a low level API that is very powerful, and we will continue evolving it. Intl.DateTimeFormat.prototype.formatToParts is just one more thing that we have added recently (stage 4). Patterns, and Skeletons (which are not the same) have been a topic of discussion many times, e

Re: Re: Consider date formatting

2017-09-21 Thread Darien Valentine
I think there is a pretty good case to be made for native support for pattern-based formatting as the OP described. I believe it has prior art in other languages and, while the highly configurable, internationalized formatting provided by `Intl.DateTimeFormat.prototype.format` is very valuable, pat

Re: Consider date formatting

2017-09-21 Thread Maggie Pint
Substantial work is being put into a date standard library and formatting currently. There is a stage 1 proposal to rework the date library here: https://github.com/tc39/proposal-temporal. I have a shim for that proposal started here: https://github.com/maggiepint/temporal-shim. I will probably see

Re: Consider date formatting

2017-09-21 Thread Matthew Robb
I just mean to say that it makes more sense as a userland lib outside of the context of browsers. - Matthew Robb On Thu, Sep 21, 2017 at 9:35 AM, Michael Kriegel < michael.krie...@actifsource.com> wrote: > Actually I used it in node.js today - where using/deploying another lib is > less "painfu

Re: Consider date formatting

2017-09-21 Thread Michael Kriegel
Actually I used it in node.js today - where using/deploying another lib is less "painful" - agreed. Still I don't think it is browser scope only... On 21.09.2017 14:59, Matthew Robb wrote: +1 this sentiment Raise your hand if you are using Moment.js in projects today? Raise your hand if you s

Re: Consider date formatting

2017-09-21 Thread Isiah Meadows
No, you're probably thinking of ECMA 404, which handles all the ES `Intl.*` stuff. It's still under the TC39 umbrella, just not part of ES proper. On Thu, Sep 21, 2017, 09:14 Isiah Meadows wrote: > I wouldn't quite call Moment and similar "de facto standards", especially > not to the degree of s

Re: Consider date formatting

2017-09-21 Thread Isiah Meadows
I wouldn't quite call Moment and similar "de facto standards", especially not to the degree of something like Underscore/Lodash or Promises/A+ (especially Bluebird), which resulted in numerous obvious additions to the spec - ES5 function and array methods are nearly a clone of those in Underscore,

Re: Consider date formatting

2017-09-21 Thread Matthew Robb
+1 this sentiment Raise your hand if you are using Moment.js in projects today? Raise your hand if you ship the library wholesale? Raise your hand if you use webpack tok strip out the locale files which add sig. heft to your bundle? Moment.js should be standardized... HOWEVER: The language spec

Re: Consider date formatting

2017-09-21 Thread Michael Kriegel
Quoting my initial posting: > I know there are libraries for that, but I think it is fundamental enough to put it into the standard instead. Isn't it legitimate to ask for a defacto-standard to become a real standard... On 21.09.2017 09:13, Bob Myers wrote: There are third-party libraries

Re: Consider date formatting

2017-09-21 Thread Bob Myers
There are third-party libraries which are so widely-used as to be defacto standards. Bob On Thu, Sep 21, 2017 at 12:11 PM, Michael Kriegel < michael.krie...@actifsource.com> wrote: > I would like to suggest to take up date formatting into the standard. > Either as optional format parameter on Dat

Re: Consider date formatting

2017-09-21 Thread Michael Kriegel
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.

Re: Consider date formatting

2017-09-20 Thread kdex
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

Re: Consider date formatting

2017-09-20 Thread Michael Kriegel
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.2

Re: Consider date formatting

2017-09-20 Thread kdex
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.t