|
|
import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f} from "./CalendarDate.mjs"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const $b956b2d7a6cf451f$var$ETHIOPIC_EPOCH = 1723856; |
|
|
const $b956b2d7a6cf451f$var$COPTIC_EPOCH = 1824665; |
|
|
|
|
|
|
|
|
const $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA = 5500; |
|
|
function $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, month, day) { |
|
|
return epoch |
|
|
+ 365 * year |
|
|
+ Math.floor(year / 4) |
|
|
+ 30 * (month - 1 |
|
|
) + day - 1 |
|
|
; |
|
|
} |
|
|
function $b956b2d7a6cf451f$var$julianDayToCE(epoch, jd) { |
|
|
let year = Math.floor(4 * (jd - epoch) / 1461); |
|
|
let month = 1 + Math.floor((jd - $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, 1, 1)) / 30); |
|
|
let day = jd + 1 - $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, month, 1); |
|
|
return [ |
|
|
year, |
|
|
month, |
|
|
day |
|
|
]; |
|
|
} |
|
|
function $b956b2d7a6cf451f$var$getLeapDay(year) { |
|
|
return Math.floor(year % 4 / 3); |
|
|
} |
|
|
function $b956b2d7a6cf451f$var$getDaysInMonth(year, month) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (month % 13 !== 0) |
|
|
return 30; |
|
|
else |
|
|
return $b956b2d7a6cf451f$var$getLeapDay(year) + 5; |
|
|
} |
|
|
class $b956b2d7a6cf451f$export$26ba6eab5e20cd7d { |
|
|
fromJulianDay(jd) { |
|
|
let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, jd); |
|
|
let era = 'AM'; |
|
|
if (year <= 0) { |
|
|
era = 'AA'; |
|
|
year += $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA; |
|
|
} |
|
|
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, era, year, month, day); |
|
|
} |
|
|
toJulianDay(date) { |
|
|
let year = date.year; |
|
|
if (date.era === 'AA') year -= $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA; |
|
|
return $b956b2d7a6cf451f$var$ceToJulianDay($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, year, date.month, date.day); |
|
|
} |
|
|
getDaysInMonth(date) { |
|
|
return $b956b2d7a6cf451f$var$getDaysInMonth(date.year, date.month); |
|
|
} |
|
|
getMonthsInYear() { |
|
|
return 13; |
|
|
} |
|
|
getDaysInYear(date) { |
|
|
return 365 + $b956b2d7a6cf451f$var$getLeapDay(date.year); |
|
|
} |
|
|
getYearsInEra(date) { |
|
|
|
|
|
|
|
|
|
|
|
return date.era === 'AA' ? 9999 : 9991; |
|
|
} |
|
|
getEras() { |
|
|
return [ |
|
|
'AA', |
|
|
'AM' |
|
|
]; |
|
|
} |
|
|
constructor(){ |
|
|
this.identifier = 'ethiopic'; |
|
|
} |
|
|
} |
|
|
class $b956b2d7a6cf451f$export$d72e0c37005a4914 extends $b956b2d7a6cf451f$export$26ba6eab5e20cd7d { |
|
|
fromJulianDay(jd) { |
|
|
let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, jd); |
|
|
year += $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA; |
|
|
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, 'AA', year, month, day); |
|
|
} |
|
|
getEras() { |
|
|
return [ |
|
|
'AA' |
|
|
]; |
|
|
} |
|
|
getYearsInEra() { |
|
|
|
|
|
return 9999; |
|
|
} |
|
|
constructor(...args){ |
|
|
super(...args), this.identifier = 'ethioaa' |
|
|
; |
|
|
} |
|
|
} |
|
|
class $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1 extends $b956b2d7a6cf451f$export$26ba6eab5e20cd7d { |
|
|
fromJulianDay(jd) { |
|
|
let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$COPTIC_EPOCH, jd); |
|
|
let era = 'CE'; |
|
|
if (year <= 0) { |
|
|
era = 'BCE'; |
|
|
year = 1 - year; |
|
|
} |
|
|
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, era, year, month, day); |
|
|
} |
|
|
toJulianDay(date) { |
|
|
let year = date.year; |
|
|
if (date.era === 'BCE') year = 1 - year; |
|
|
return $b956b2d7a6cf451f$var$ceToJulianDay($b956b2d7a6cf451f$var$COPTIC_EPOCH, year, date.month, date.day); |
|
|
} |
|
|
getDaysInMonth(date) { |
|
|
let year = date.year; |
|
|
if (date.era === 'BCE') year = 1 - year; |
|
|
return $b956b2d7a6cf451f$var$getDaysInMonth(year, date.month); |
|
|
} |
|
|
isInverseEra(date) { |
|
|
return date.era === 'BCE'; |
|
|
} |
|
|
balanceDate(date) { |
|
|
if (date.year <= 0) { |
|
|
date.era = date.era === 'BCE' ? 'CE' : 'BCE'; |
|
|
date.year = 1 - date.year; |
|
|
} |
|
|
} |
|
|
getEras() { |
|
|
return [ |
|
|
'BCE', |
|
|
'CE' |
|
|
]; |
|
|
} |
|
|
getYearsInEra(date) { |
|
|
|
|
|
|
|
|
|
|
|
return date.era === 'BCE' ? 9999 : 9715; |
|
|
} |
|
|
constructor(...args){ |
|
|
super(...args), this.identifier = 'coptic'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export {$b956b2d7a6cf451f$export$26ba6eab5e20cd7d as EthiopicCalendar, $b956b2d7a6cf451f$export$d72e0c37005a4914 as EthiopicAmeteAlemCalendar, $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1 as CopticCalendar}; |
|
|
|
|
|
|