I want to use Intl.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',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Asia/Tehran',
IntlDateFormatter::TRADITIONAL,
'EEEE d MMMM yyyy HH:mm' // as ISO_8601
);
echo datefmt_format($fmt, time()) . "\n";
// پنجشنبه ۱۰ اردیبهشت ۱۳۹۴ ۱۲:۱۲
How can i set pattern as ICU documentation in Intl.DateTimeFormat like php version of ICU date time formatter.
My javascript code
console.log(new Intl.DateTimeFormat('fa-IR-u-ca-persian').format(new Date()));
How can iset ISO_8601 pattern in my javascript format pattern like EEEE d MMMM yyyy HH:mm
or MM yy dd
or etc ?