UNPKG

react-native-ethiopian-calendar

Version:

A react native calendar component which is mainly intended for applications which require Ethiopian calendar.

39 lines (36 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toGregorian = exports.toEthiopic = exports.gregorianCalendar = exports.ethiopicCalendar = void 0; var _Ethiopic = require("../Ethiopic"); var _Gregorian = require("../Gregorian"); const ethiopicCalendar = new _Ethiopic.EthiopicCalendar(); exports.ethiopicCalendar = ethiopicCalendar; const gregorianCalendar = new _Gregorian.GregorianCalendar(); /** * Convert Gregorian Date to Ethiopic Date. * @param year * @param month * @param day * @returns Date object. */ exports.gregorianCalendar = gregorianCalendar; const toEthiopic = (year, month, day) => { const gregorianJdn = gregorianCalendar.toJDN(year, month, day); return ethiopicCalendar.fromJDN(gregorianJdn); }; /** * Convert Ethiopic Date to Gregorian Date. * @param year * @param month * @param day * @returns Date object. */ exports.toEthiopic = toEthiopic; const toGregorian = (year, month, day) => { const ethioJdn = ethiopicCalendar.toJDN(year, month, day); return gregorianCalendar.fromJDN(ethioJdn); }; exports.toGregorian = toGregorian; //# sourceMappingURL=CalendarConvertor.js.map