function civilDate(options, date) { var opts = Object.assign({timeZone: "Asia/Riyadh"}, options); returnnew Intl.DateTimeFormat("ar-SA-u-ca-islamic-civil-nu-latn", opts).format(date);
}
function tabularDate(options, date) { var opts = Object.assign({timeZone: "Asia/Riyadh"}, options); returnnew Intl.DateTimeFormat("ar-SA-u-ca-islamic-tbla-nu-latn", opts).format(date);
}
function sightingDate(options, date) { var opts = Object.assign({timeZone: "Asia/Riyadh"}, options); returnnew Intl.DateTimeFormat("ar-SA-u-ca-islamic-rgsa-nu-latn", opts).format(date);
}
function ummAlQuraDate(options, date) { var opts = Object.assign({timeZone: "Asia/Riyadh"}, options); returnnew Intl.DateTimeFormat("ar-SA-u-ca-islamic-umalqura-nu-latn", opts).format(date);
}
// Test islamic-tbla (Tabular / Thursday epoch). // Compare with islamic-civil (Tabular / Friday epoch). function testIslamicTbla() { var date = new Date(Date.UTC(2015, 1 - 1, 1));
// Month and year are the same. var monthYear = {year: "numeric", month: "numeric"};
assertEq(civilDate(monthYear, date), tabularDate(monthYear, date));
// Day is different by one. var day = {day: "numeric"};
assertEq(Number(civilDate(day, date)) - Number(tabularDate(day, date)), -1);
}
// Test islamic-rgsa (Saudi Arabia sighting). // Sighting of the hilal (crescent moon) in Saudi Arabia. function testIslamicRgsa() { var date1 = new Date(Date.UTC(1975, 5 - 1, 6)); var date2 = new Date(Date.UTC(2015, 1 - 1, 1)); var dayMonthYear = {year: "numeric", month: "numeric", day: "numeric"};
// Test islamic-umalqura (Umm al-Qura). function testIslamicUmalqura() { var year = {year: "numeric"}; var month = {month: "numeric"}; var day = {day: "numeric"};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.