I want to use Intl.DateTimeFormat
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
but with custom pattern for output. I use this method for php version of
ICU dateformat and it's work well.
$fmt = datefmt_create(
'fa_IR@calendar=persian',
In JS it seems it'd be more useful if it worked with undefined not null.
Thanks,
Michael McGlothlin
Sent from my iPhone
On Aug 16, 2015, at 7:33 PM, Brandon Andrews warcraftthre...@sbcglobal.net
wrote:
https://en.wikipedia.org/wiki/Null_coalescing_operator
Essentially x ?? y will return
https://en.wikipedia.org/wiki/Null_coalescing_operator
Essentially x ?? y will return x when not null or undefined else it will return
y.
A nice Javascript explanation of the current problems with using || that can
cause unforeseen bugs:
http://stackoverflow.com/a/476445
This is something I frequently make a helper function out of.
```js
function d(argument, default_) {
return argument != null ? argument : default_
}
```
On Sun, Aug 16, 2015, 20:34 Brandon Andrews warcraftthre...@sbcglobal.net
wrote:
https://en.wikipedia.org/wiki/Null_coalescing_operator
A link to a wikipedia article is not *actually* a proposal : )
As Michael points out, you need to at least provide some consideration for
null vs. undefined. I would also like to see some thought given to how
such an operator might interact with a null propagation operator, discussed
here:
Intl.DateTimeFormat doesn’t currently let you specify a custom pattern in
ICU/CLDR format. The reason is that the API had to be implemented on top of
different existing internationalization APIs, and the API on Windows didn’t
support CLDR date format patterns.
There is a feature request for
I know it's a little late for this, but what was the rationale of using
only `undefined` instead of both that and `null` to denote omitted values
for optional arguments in ES6? Before this change, it was a frequent idiom
to check optional arguments via `== null` instead of `=== undefined` and
pass
7 matches
Mail list logo