Closed sm2017 closed 6 years ago
According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
The following Unicode extension keys are allowed: nu Numbering system. Possible values include: "arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt". ca Calendar. Possible values include: "buddhist", "chinese", "coptic", "ethioaa", "ethiopic", "gregory", "hebrew", "indian", "islamic", "islamicc", "iso8601", "japanese", "persian", "roc".
The following Unicode extension keys are allowed:
nu Numbering system. Possible values include: "arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt". ca Calendar. Possible values include: "buddhist", "chinese", "coptic", "ethioaa", "ethiopic", "gregory", "hebrew", "indian", "islamic", "islamicc", "iso8601", "japanese", "persian", "roc".
I test the following code
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0)); console.log(new Intl.DateTimeFormat(['fa-u-ca-persian-nu-arab']).format(date));
But the result is not persian calendar it is gregorian , How can I have non-gregorian calendar
persian
gregorian
non-gregorian
This polyfill only support gregorian calendar ATM: https://github.com/andyearnshaw/Intl.js/blob/68514268e4f6b97a9323f6be9e75bd5a1216777a/README.md#not-implemented
According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
I test the following code
But the result is not
persian
calendar it isgregorian
, How can I havenon-gregorian
calendar