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, pattern-based formatting serves different purposes.
@ Maggie I’m very excited to see ES getting distinct, hack-free types for representing the different kinds of date/date time values that we often awkwardly conflate with the generic datetime Date. The immutability is refreshing — I cannot think of a time I ever thought "gee, I’m glad date objects are mutable". @ kai zhu, I appreciate the perspective you try to bring to things on these forums, but I don’t think that your campaign for simplicity is well-served by arguing that people should roll their own date manipulation utilities. :) In many cases, it’s true that one needs nothing more than Date, and it’s also been my experience that sometimes when people think "but timezones!" they are creating, not solving, problems. However, cases that do demand more nuance aren’t uncommon, and when you wrote that date arithmetic is "trivial to do with 3-lines of vanilla javascript code", ten thousand dead developers briefly reanimated in their graves and hissed demonic curses.
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss