🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

kenat

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kenat - npm Package Compare versions

Comparing version
2.3.0
to
3.0.0
+19
tsconfig.json
{
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "./types",
"outDir": "./dist",
"rootDir": "./src",
"target": "ES2020",
"module": "ESNext",
"lib": ["es2022", "dom", "es2020.intl"],
"skipLibCheck": true,
"noEmitOnError": true
},
"include": [
"src/**/*.js"
]
}
/**
* Calculates all Bahire Hasab values for a given Ethiopian year, including all movable feasts.
*
* @param {number} ethiopianYear - The Ethiopian year to calculate for.
* @param {Object} [options={}] - Options for language.
* @param {string} [options.lang='amharic'] - The language for names.
* @returns {Object} An object containing all the calculated Bahire Hasab values.
*/
export function getBahireHasab(ethiopianYear: number, options?: {
lang?: string;
}): any;
/**
* Calculates the date of a movable holiday for a given year.
* This is now a pure date calculator that returns a simple date object,
* ensuring backward compatibility with existing tests.
*
* @param {'ABIY_TSOME'|'TINSAYE'|'ERGET'|...} holidayKey - The key of the holiday from movableHolidayTewsak.
* @param {number} ethiopianYear - The Ethiopian year.
* @returns {Object} An Ethiopian date object { year, month, day }.
*/
export function getMovableHoliday(holidayKey: any, ethiopianYear: number): any;
export namespace monthNames {
let english: string[];
let amharic: string[];
let gregorian: string[];
}
export namespace daysOfWeek {
let english_1: string[];
export { english_1 as english };
let amharic_1: string[];
export { amharic_1 as amharic };
}
export namespace HolidayTags {
let PUBLIC: string;
let RELIGIOUS: string;
let CHRISTIAN: string;
let MUSLIM: string;
let STATE: string;
let CULTURAL: string;
let OTHER: string;
}
export namespace keyToTewsakMap {
let nineveh: string;
let abiyTsome: string;
let debreZeit: string;
let hosanna: string;
let siklet: string;
let fasika: string;
let rikbeKahnat: string;
let erget: string;
let paraclete: string;
let tsomeHawaryat: string;
let tsomeDihnet: string;
}
export namespace PERIOD_LABELS {
let day: string;
let night: string;
}
export namespace holidayInfo {
export namespace enkutatash {
namespace name {
let amharic_2: string;
export { amharic_2 as amharic };
let english_2: string;
export { english_2 as english };
}
namespace description {
let amharic_3: string;
export { amharic_3 as amharic };
let english_3: string;
export { english_3 as english };
}
}
export namespace meskel {
export namespace name_1 {
let amharic_4: string;
export { amharic_4 as amharic };
let english_4: string;
export { english_4 as english };
}
export { name_1 as name };
export namespace description_1 {
let amharic_5: string;
export { amharic_5 as amharic };
let english_5: string;
export { english_5 as english };
}
export { description_1 as description };
}
export namespace beherbehereseb {
export namespace name_2 {
let amharic_6: string;
export { amharic_6 as amharic };
let english_6: string;
export { english_6 as english };
}
export { name_2 as name };
export namespace description_2 {
let amharic_7: string;
export { amharic_7 as amharic };
let english_7: string;
export { english_7 as english };
}
export { description_2 as description };
}
export namespace gena {
export namespace name_3 {
let amharic_8: string;
export { amharic_8 as amharic };
let english_8: string;
export { english_8 as english };
}
export { name_3 as name };
export namespace description_3 {
let amharic_9: string;
export { amharic_9 as amharic };
let english_9: string;
export { english_9 as english };
}
export { description_3 as description };
}
export namespace timket {
export namespace name_4 {
let amharic_10: string;
export { amharic_10 as amharic };
let english_10: string;
export { english_10 as english };
}
export { name_4 as name };
export namespace description_4 {
let amharic_11: string;
export { amharic_11 as amharic };
let english_11: string;
export { english_11 as english };
}
export { description_4 as description };
}
export namespace martyrsDay {
export namespace name_5 {
let amharic_12: string;
export { amharic_12 as amharic };
let english_12: string;
export { english_12 as english };
}
export { name_5 as name };
export namespace description_5 {
let amharic_13: string;
export { amharic_13 as amharic };
let english_13: string;
export { english_13 as english };
}
export { description_5 as description };
}
export namespace adwa {
export namespace name_6 {
let amharic_14: string;
export { amharic_14 as amharic };
let english_14: string;
export { english_14 as english };
}
export { name_6 as name };
export namespace description_6 {
let amharic_15: string;
export { amharic_15 as amharic };
let english_15: string;
export { english_15 as english };
}
export { description_6 as description };
}
export namespace labour {
export namespace name_7 {
let amharic_16: string;
export { amharic_16 as amharic };
let english_16: string;
export { english_16 as english };
}
export { name_7 as name };
export namespace description_7 {
let amharic_17: string;
export { amharic_17 as amharic };
let english_17: string;
export { english_17 as english };
}
export { description_7 as description };
}
export namespace patriots {
export namespace name_8 {
let amharic_18: string;
export { amharic_18 as amharic };
let english_18: string;
export { english_18 as english };
}
export { name_8 as name };
export namespace description_8 {
let amharic_19: string;
export { amharic_19 as amharic };
let english_19: string;
export { english_19 as english };
}
export { description_8 as description };
}
export namespace nineveh_1 {
export namespace name_9 {
let amharic_20: string;
export { amharic_20 as amharic };
let english_20: string;
export { english_20 as english };
}
export { name_9 as name };
export namespace description_9 {
let amharic_21: string;
export { amharic_21 as amharic };
let english_21: string;
export { english_21 as english };
}
export { description_9 as description };
}
export { nineveh_1 as nineveh };
export namespace abiyTsome_1 {
export namespace name_10 {
let amharic_22: string;
export { amharic_22 as amharic };
let english_22: string;
export { english_22 as english };
}
export { name_10 as name };
export namespace description_10 {
let amharic_23: string;
export { amharic_23 as amharic };
let english_23: string;
export { english_23 as english };
}
export { description_10 as description };
}
export { abiyTsome_1 as abiyTsome };
export namespace debreZeit_1 {
export namespace name_11 {
let amharic_24: string;
export { amharic_24 as amharic };
let english_24: string;
export { english_24 as english };
}
export { name_11 as name };
export namespace description_11 {
let amharic_25: string;
export { amharic_25 as amharic };
let english_25: string;
export { english_25 as english };
}
export { description_11 as description };
}
export { debreZeit_1 as debreZeit };
export namespace hosanna_1 {
export namespace name_12 {
let amharic_26: string;
export { amharic_26 as amharic };
let english_26: string;
export { english_26 as english };
}
export { name_12 as name };
export namespace description_12 {
let amharic_27: string;
export { amharic_27 as amharic };
let english_27: string;
export { english_27 as english };
}
export { description_12 as description };
}
export { hosanna_1 as hosanna };
export namespace siklet_1 {
export namespace name_13 {
let amharic_28: string;
export { amharic_28 as amharic };
let english_28: string;
export { english_28 as english };
}
export { name_13 as name };
export namespace description_13 {
let amharic_29: string;
export { amharic_29 as amharic };
let english_29: string;
export { english_29 as english };
}
export { description_13 as description };
}
export { siklet_1 as siklet };
export namespace fasika_1 {
export namespace name_14 {
let amharic_30: string;
export { amharic_30 as amharic };
let english_30: string;
export { english_30 as english };
}
export { name_14 as name };
export namespace description_14 {
let amharic_31: string;
export { amharic_31 as amharic };
let english_31: string;
export { english_31 as english };
}
export { description_14 as description };
}
export { fasika_1 as fasika };
export namespace rikbeKahnat_1 {
export namespace name_15 {
let amharic_32: string;
export { amharic_32 as amharic };
let english_32: string;
export { english_32 as english };
}
export { name_15 as name };
export namespace description_15 {
let amharic_33: string;
export { amharic_33 as amharic };
let english_33: string;
export { english_33 as english };
}
export { description_15 as description };
}
export { rikbeKahnat_1 as rikbeKahnat };
export namespace erget_1 {
export namespace name_16 {
let amharic_34: string;
export { amharic_34 as amharic };
let english_34: string;
export { english_34 as english };
}
export { name_16 as name };
export namespace description_16 {
let amharic_35: string;
export { amharic_35 as amharic };
let english_35: string;
export { english_35 as english };
}
export { description_16 as description };
}
export { erget_1 as erget };
export namespace paraclete_1 {
export namespace name_17 {
let amharic_36: string;
export { amharic_36 as amharic };
let english_36: string;
export { english_36 as english };
}
export { name_17 as name };
export namespace description_17 {
let amharic_37: string;
export { amharic_37 as amharic };
let english_37: string;
export { english_37 as english };
}
export { description_17 as description };
}
export { paraclete_1 as paraclete };
export namespace tsomeHawaryat_1 {
export namespace name_18 {
let amharic_38: string;
export { amharic_38 as amharic };
let english_38: string;
export { english_38 as english };
}
export { name_18 as name };
export namespace description_18 {
let amharic_39: string;
export { amharic_39 as amharic };
let english_39: string;
export { english_39 as english };
}
export { description_18 as description };
}
export { tsomeHawaryat_1 as tsomeHawaryat };
export namespace tsomeDihnet_1 {
export namespace name_19 {
let amharic_40: string;
export { amharic_40 as amharic };
let english_40: string;
export { english_40 as english };
}
export { name_19 as name };
export namespace description_19 {
let amharic_41: string;
export { amharic_41 as amharic };
let english_41: string;
export { english_41 as english };
}
export { description_19 as description };
}
export { tsomeDihnet_1 as tsomeDihnet };
export namespace eidFitr {
export namespace name_20 {
let amharic_42: string;
export { amharic_42 as amharic };
let english_42: string;
export { english_42 as english };
}
export { name_20 as name };
export namespace description_20 {
let amharic_43: string;
export { amharic_43 as amharic };
let english_43: string;
export { english_43 as english };
}
export { description_20 as description };
}
export namespace eidAdha {
export namespace name_21 {
let amharic_44: string;
export { amharic_44 as amharic };
let english_44: string;
export { english_44 as english };
}
export { name_21 as name };
export namespace description_21 {
let amharic_45: string;
export { amharic_45 as amharic };
let english_45: string;
export { english_45 as english };
}
export { description_21 as description };
}
export namespace moulid {
export namespace name_22 {
let amharic_46: string;
export { amharic_46 as amharic };
let english_46: string;
export { english_46 as english };
}
export { name_22 as name };
export namespace description_22 {
let amharic_47: string;
export { amharic_47 as amharic };
let english_47: string;
export { english_47 as english };
}
export { description_22 as description };
}
export namespace jummah {
export namespace name_23 {
let amharic_48: string;
export { amharic_48 as amharic };
let english_48: string;
export { english_48 as english };
}
export { name_23 as name };
export namespace description_23 {
let amharic_49: string;
export { amharic_49 as amharic };
let english_49: string;
export { english_49 as english };
}
export { description_23 as description };
}
}
export namespace evangelistNames {
let english_50: {
1: string;
2: string;
3: string;
0: string;
};
export { english_50 as english };
let amharic_50: {
1: string;
2: string;
3: string;
0: string;
};
export { amharic_50 as amharic };
}
export namespace tewsakMap {
let Sunday: number;
let Monday: number;
let Tuesday: number;
let Wednesday: number;
let Thursday: number;
let Friday: number;
let Saturday: number;
}
export namespace movableHolidayTewsak {
let NINEVEH: number;
let ABIY_TSOME: number;
let DEBRE_ZEIT: number;
let HOSANNA: number;
let SIKLET: number;
let TINSAYE: number;
let RIKBE_KAHNAT: number;
let ERGET: number;
let PARACLETE: number;
let TSOME_HAWARYAT: number;
let TSOME_DIHENET: number;
}
export namespace movableHolidays {
export namespace nineveh_2 {
let tags: string[];
}
export { nineveh_2 as nineveh };
export namespace abiyTsome_2 {
let tags_1: string[];
export { tags_1 as tags };
}
export { abiyTsome_2 as abiyTsome };
export namespace debreZeit_2 {
let tags_2: string[];
export { tags_2 as tags };
}
export { debreZeit_2 as debreZeit };
export namespace hosanna_2 {
let tags_3: string[];
export { tags_3 as tags };
}
export { hosanna_2 as hosanna };
export namespace siklet_2 {
let tags_4: string[];
export { tags_4 as tags };
}
export { siklet_2 as siklet };
export namespace fasika_2 {
let tags_5: string[];
export { tags_5 as tags };
}
export { fasika_2 as fasika };
export namespace rikbeKahnat_2 {
let tags_6: string[];
export { tags_6 as tags };
}
export { rikbeKahnat_2 as rikbeKahnat };
export namespace erget_2 {
let tags_7: string[];
export { tags_7 as tags };
}
export { erget_2 as erget };
export namespace paraclete_2 {
let tags_8: string[];
export { tags_8 as tags };
}
export { paraclete_2 as paraclete };
export namespace tsomeHawaryat_2 {
let tags_9: string[];
export { tags_9 as tags };
}
export { tsomeHawaryat_2 as tsomeHawaryat };
export namespace tsomeDihnet_2 {
let tags_10: string[];
export { tags_10 as tags };
}
export { tsomeDihnet_2 as tsomeDihnet };
export namespace eidFitr_1 {
let tags_11: string[];
export { tags_11 as tags };
}
export { eidFitr_1 as eidFitr };
export namespace eidAdha_1 {
let tags_12: string[];
export { tags_12 as tags };
}
export { eidAdha_1 as eidAdha };
export namespace moulid_1 {
let tags_13: string[];
export { tags_13 as tags };
}
export { moulid_1 as moulid };
}
export namespace FastingKeys {
let ABIY_TSOME_1: string;
export { ABIY_TSOME_1 as ABIY_TSOME };
let TSOME_HAWARYAT_1: string;
export { TSOME_HAWARYAT_1 as TSOME_HAWARYAT };
export let TSOME_NEBIYAT: string;
let NINEVEH_1: string;
export { NINEVEH_1 as NINEVEH };
export let FILSETA: string;
export let RAMADAN: string;
let TSOME_DIHENET_1: string;
export { TSOME_DIHENET_1 as TSOME_DIHENET };
}
export namespace fastingInfo {
export namespace ABIY_TSOME_2 {
export namespace name_24 {
let amharic_51: string;
export { amharic_51 as amharic };
let english_51: string;
export { english_51 as english };
}
export { name_24 as name };
export namespace description_24 {
let amharic_52: string;
export { amharic_52 as amharic };
let english_52: string;
export { english_52 as english };
}
export { description_24 as description };
let tags_14: string[];
export { tags_14 as tags };
}
export { ABIY_TSOME_2 as ABIY_TSOME };
export namespace NINEVEH_2 {
export namespace name_25 {
let amharic_53: string;
export { amharic_53 as amharic };
let english_53: string;
export { english_53 as english };
}
export { name_25 as name };
export namespace description_25 {
let amharic_54: string;
export { amharic_54 as amharic };
let english_54: string;
export { english_54 as english };
}
export { description_25 as description };
let tags_15: string[];
export { tags_15 as tags };
}
export { NINEVEH_2 as NINEVEH };
export namespace TSOME_HAWARYAT_2 {
export namespace name_26 {
let amharic_55: string;
export { amharic_55 as amharic };
let english_55: string;
export { english_55 as english };
}
export { name_26 as name };
export namespace description_26 {
let amharic_56: string;
export { amharic_56 as amharic };
let english_56: string;
export { english_56 as english };
}
export { description_26 as description };
let tags_16: string[];
export { tags_16 as tags };
}
export { TSOME_HAWARYAT_2 as TSOME_HAWARYAT };
export namespace TSOME_NEBIYAT_1 {
export namespace name_27 {
let amharic_57: string;
export { amharic_57 as amharic };
let english_57: string;
export { english_57 as english };
}
export { name_27 as name };
export namespace description_27 {
let amharic_58: string;
export { amharic_58 as amharic };
let english_58: string;
export { english_58 as english };
}
export { description_27 as description };
let tags_17: string[];
export { tags_17 as tags };
}
export { TSOME_NEBIYAT_1 as TSOME_NEBIYAT };
export namespace FILSETA_1 {
export namespace name_28 {
let amharic_59: string;
export { amharic_59 as amharic };
let english_59: string;
export { english_59 as english };
}
export { name_28 as name };
export namespace description_28 {
let amharic_60: string;
export { amharic_60 as amharic };
let english_60: string;
export { english_60 as english };
}
export { description_28 as description };
let tags_18: string[];
export { tags_18 as tags };
}
export { FILSETA_1 as FILSETA };
export namespace RAMADAN_1 {
export namespace name_29 {
let amharic_61: string;
export { amharic_61 as amharic };
let english_61: string;
export { english_61 as english };
}
export { name_29 as name };
export namespace description_29 {
let amharic_62: string;
export { amharic_62 as amharic };
let english_62: string;
export { english_62 as english };
}
export { description_29 as description };
let tags_19: string[];
export { tags_19 as tags };
}
export { RAMADAN_1 as RAMADAN };
export namespace TSOME_DIHENET_2 {
export namespace name_30 {
let amharic_63: string;
export { amharic_63 as amharic };
let english_63: string;
export { english_63 as english };
}
export { name_30 as name };
export namespace description_30 {
let amharic_64: string;
export { amharic_64 as amharic };
let english_64: string;
export { english_64 as english };
}
export { description_30 as description };
let tags_20: string[];
export { tags_20 as tags };
}
export { TSOME_DIHENET_2 as TSOME_DIHENET };
}
/**
* Converts an Ethiopian date to its corresponding Gregorian date.
*
* @param {number} ethYear - The Ethiopian year.
* @param {number} ethMonth - The Ethiopian month (1-13).
* @param {number} ethDay - The Ethiopian day of the month.
* @returns {{ year: number, month: number, day: number }} The equivalent Gregorian date.
* @throws {InvalidInputTypeError} If any input is not a number.
* @throws {InvalidEthiopianDateError} If the provided Ethiopian date is invalid.
*/
export function toGC(ethYear: number, ethMonth: number, ethDay: number): {
year: number;
month: number;
day: number;
};
/**
* Converts a Gregorian date to the Ethiopian calendar (EC) date.
*
* @param {number} gYear - The Gregorian year (e.g., 2024).
* @param {number} gMonth - The Gregorian month (1-12).
* @param {number} gDay - The Gregorian day of the month (1-31).
* @returns {{ year: number, month: number, day: number }} The corresponding Ethiopian calendar date.
* @throws {InvalidInputTypeError} If any input is not a number.
* @throws {InvalidGregorianDateError} If the input date is invalid or out of supported range.
*/
export function toEC(gYear: number, gMonth: number, gDay: number): {
year: number;
month: number;
day: number;
};
/**
* Converts an Ethiopian date to a Gregorian Calendar JavaScript Date object (UTC).
*
* @param {number} ethYear - The Ethiopian year.
* @param {number} ethMonth - The Ethiopian month (1-based).
* @param {number} ethDay - The Ethiopian day.
* @returns {Date} A JavaScript Date object representing the equivalent Gregorian date in UTC.
*/
export function toGCDate(ethYear: number, ethMonth: number, ethDay: number): Date;
/**
* Converts a JavaScript Date object to the Ethiopian Calendar (EC) date representation.
*
* @param {Date} dateObj - The JavaScript Date object to convert.
* @returns {*} The Ethiopian Calendar date, as returned by the `toEC` function.
*/
export function fromDateToEC(dateObj: Date): any;
/**
* Get Hijri year from a Gregorian date
* @param {Date} date
* @returns {number} hijri year
*/
export function getHijriYear(date: Date): number;
/**
* Converts a Hijri date to the corresponding Gregorian date within a given Gregorian year.
*
* @param {number} hYear - Hijri year (e.g., 1445)
* @param {number} hMonth - Hijri month (1–12)
* @param {number} hDay - Hijri day (1–30)
* @param {number} gregorianYear - Target Gregorian year to restrict the search range
* @returns {Date|null} Gregorian Date object or null if not found
*/
export function hijriToGregorian(hYear: number, hMonth: number, hDay: number, gregorianYear: number): Date | null;
export const islamicFormatter: Intl.DateTimeFormat;
/**
* Adds a specified number of days to an Ethiopian date.
*
* @param {Object} ethiopian - The Ethiopian date object { year, month, day }.
* @param {number} days - The number of days to add.
* @returns {Object} The resulting Ethiopian date.
* @throws {InvalidInputTypeError} If inputs are not of the correct type.
*/
export function addDays(ethiopian: any, days: number): any;
/**
* Adds a specified number of months to an Ethiopian date.
*
* @param {Object} ethiopian - The Ethiopian date object { year, month, day }.
* @param {number} months - The number of months to add.
* @returns {Object} The resulting Ethiopian date.
* @throws {InvalidInputTypeError} If inputs are not of the correct type.
*/
export function addMonths(ethiopian: any, months: number): any;
/**
* Adds a specified number of years to an Ethiopian date.
*
* @param {Object} ethiopian - The Ethiopian date object { year, month, day }.
* @param {number} years - The number of years to add.
* @returns {Object} The resulting Ethiopian date.
* @throws {InvalidInputTypeError} If inputs are not of the correct type.
*/
export function addYears(ethiopian: any, years: number): any;
/**
* Calculates the difference in days between two Ethiopian dates.
*
* @param {Object} a - The first Ethiopian date object.
* @param {Object} b - The second Ethiopian date object.
* @returns {number} The difference in days.
* @throws {InvalidInputTypeError} If inputs are not valid date objects.
*/
export function diffInDays(a: any, b: any): number;
/**
* Calculates the difference in months between two Ethiopian dates.
*
* @param {Object} a - The first Ethiopian date object.
* @param {Object} b - The second Ethiopian date object.
* @returns {number} The difference in months.
* @throws {InvalidInputTypeError} If inputs are not valid date objects.
*/
export function diffInMonths(a: any, b: any): number;
/**
* Calculates the difference in years between two Ethiopian dates.
*
* @param {Object} a - The first Ethiopian date object.
* @param {Object} b - The second Ethiopian date object.
* @returns {number} The difference in years.
* @throws {InvalidInputTypeError} If inputs are not valid date objects.
*/
export function diffInYears(a: any, b: any): number;
/**
* Base class for all custom errors in the Kenat library.
*/
export class KenatError extends Error {
constructor(message: any);
/**
* Provides a serializable representation of the error.
* @returns {Object} A plain object with error details.
*/
toJSON(): any;
}
/**
* Thrown when an Ethiopian date is numerically invalid (e.g., month 14).
*/
export class InvalidEthiopianDateError extends KenatError {
constructor(year: any, month: any, day: any);
date: {
year: any;
month: any;
day: any;
};
}
/**
* Thrown when a Gregorian date is numerically invalid.
*/
export class InvalidGregorianDateError extends KenatError {
constructor(year: any, month: any, day: any);
date: {
year: any;
month: any;
day: any;
};
}
/**
* Thrown when a date string provided to the constructor has an invalid format.
*/
export class InvalidDateFormatError extends KenatError {
inputString: any;
}
/**
* Thrown when the Kenat constructor receives an input type it cannot handle.
*/
export class UnrecognizedInputError extends KenatError {
input: any;
}
/**
* Thrown for errors occurring during Ge'ez numeral conversion.
*/
export class GeezConverterError extends KenatError {
}
/**
* Thrown when a function receives an argument of an incorrect type.
*/
export class InvalidInputTypeError extends KenatError {
constructor(functionName: any, parameterName: any, expectedType: any, receivedValue: any);
functionName: any;
parameterName: any;
expectedType: any;
receivedValue: any;
}
/**
* Thrown for errors related to invalid time components.
*/
export class InvalidTimeError extends KenatError {
}
/**
* Thrown for invalid configuration options passed to MonthGrid.
*/
export class InvalidGridConfigError extends KenatError {
}
/**
* Thrown when an unknown holiday key is used.
*/
export class UnknownHolidayError extends KenatError {
holidayKey: any;
}
/**
* Calculates the start and end dates of a specific fasting period for a given year.
* @param {'ABIY_TSOME' | 'TSOME_HAWARYAT' | 'TSOME_NEBIYAT' | 'NINEVEH' | 'RAMADAN'} fastKey - The key for the fast.
* @param {number} ethiopianYear - The Ethiopian year.
* @returns {{start: object, end: object}|null} An object with start and end PLAIN date objects.
*/
export function getFastingPeriod(fastKey: "ABIY_TSOME" | "TSOME_HAWARYAT" | "TSOME_NEBIYAT" | "NINEVEH" | "RAMADAN", ethiopianYear: number): {
start: object;
end: object;
} | null;
/**
* Returns fasting information (names, descriptions, period) for a given fast and year.
* @param {'ABIY_TSOME'|'TSOME_HAWARYAT'|'TSOME_NEBIYAT'|'NINEVEH'|'RAMADAN'} fastKey
* @param {number} ethiopianYear
* @param {{lang?: 'amharic'|'english'}} options
* @returns {{ key: string, name: string, description: string, period: { start: object, end: object } } | null}
*/
export function getFastingInfo(fastKey: "ABIY_TSOME" | "TSOME_HAWARYAT" | "TSOME_NEBIYAT" | "NINEVEH" | "RAMADAN", ethiopianYear: number, options?: {
lang?: "amharic" | "english";
}): {
key: string;
name: string;
description: string;
period: {
start: object;
end: object;
};
} | null;
/**
* Return an array of day numbers in the given Ethiopian month that belong to a fasting period.
* For TSOME_DIHENET, it returns all Wednesdays and Fridays excluding the 50-day period after Easter (through Pentecost).
* For fixed/range fasts, it returns the days intersecting the fast period.
*
* @param {string} fastKey - One of FastingKeys
* @param {number} year - Ethiopian year
* @param {number} month - Ethiopian month (1-13)
* @returns {number[]}
*/
export function getFastingDays(fastKey: string, year: number, month: number): number[];
/**
* Formats an Ethiopian date using language-specific month name and Arabic numerals.
*
* @param {{year: number, month: number, day: number}} etDate - Ethiopian date object
* @param {'amharic'|'english'} [lang='amharic'] - Language for month name
* @returns {string} Formatted string like "መስከረም 10 2016"
*/
export function formatStandard(etDate: {
year: number;
month: number;
day: number;
}, lang?: "amharic" | "english"): string;
/**
* Formats an Ethiopian date in Geez numerals with Amharic month name.
*
* @param {{year: number, month: number, day: number}} etDate - Ethiopian date
* @returns {string} Example: "መስከረም ፲፩ ፳፻፲፮"
*/
export function formatInGeezAmharic(etDate: {
year: number;
month: number;
day: number;
}): string;
/**
* Formats an Ethiopian date and time as a string.
*
* @param {{year: number, month: number, day: number}} etDate - Ethiopian date
* @param {import('../Time.js').Time} time - An instance of the Time class
* @param {'amharic'|'english'} [lang='amharic'] - Language for suffix
* @returns {string} Example: "መስከረም 10 2016 08:30 ጠዋት"
*/
export function formatWithTime(etDate: {
year: number;
month: number;
day: number;
}, time: any, lang?: "amharic" | "english"): string;
/**
* Formats an Ethiopian date object with the weekday name, month name, day, and year.
*
* @param {Object} etDate - The Ethiopian date object to format.
* @param {number} etDate.day - The day of the month.
* @param {number} etDate.month - The month number (1-based).
* @param {number} etDate.year - The year.
* @param {string} [lang='amharic'] - The language to use for weekday and month names ('amharic', 'english', etc.).
* @param {boolean} [useGeez=false] - Whether to format the day and year in Geez numerals.
* @returns {string} The formatted date string, e.g., "ማክሰኞ, መስከረም 1 2016".
*/
export function formatWithWeekday(etDate: {
day: number;
month: number;
year: number;
}, lang?: string, useGeez?: boolean): string;
/**
* Returns Ethiopian date in short "yyyy/mm/dd" format.
* @param {{year: number, month: number, day: number}} etDate
* @returns {string} e.g., "2017/10/25"
*/
export function formatShort(etDate: {
year: number;
month: number;
day: number;
}): string;
/**
* Returns an ISO-like string: "YYYY-MM-DD" or "YYYY-MM-DDTHH:mm".
* @param {{year: number, month: number, day: number}} etDate
* @param {{hour: number, minute: number, period: 'day'|'night'}|null} time
* @returns {string}
*/
export function toISODateString(etDate: {
year: number;
month: number;
day: number;
}, time?: {
hour: number;
minute: number;
period: "day" | "night";
} | null): string;
/**
* Converts a natural number to Ethiopic numeral string.
*
* @param {number|string} input - The number to convert (positive integer only).
* @returns {string} Ethiopic numeral string.
* @throws {GeezConverterError} If input is not a valid positive integer.
*/
export function toGeez(input: number | string): string;
/**
* Converts a Ge'ez numeral string to its Arabic numeral equivalent.
*
* @param {string} geezStr - The Ge'ez numeral string to convert.
* @returns {number} The Arabic numeral representation of the input string.
* @throws {GeezConverterError} If the input is not a valid Ge'ez numeral string.
*/
export function toArabic(geezStr: string): number;
/**
* Finds the start and end dates of a specific Hijri month that falls within an Ethiopian year.
* @param {number} ethiopianYear - The Ethiopian year.
* @param {number} hijriMonth - The Hijri month to find (e.g., 9 for Ramadan).
* @returns {Array<{start: Kenat, end: Kenat}>} An array of start/end date ranges.
*/
export function findHijriMonthRanges(ethiopianYear: number, hijriMonth: number): Array<{
start: Kenat;
end: Kenat;
}>;
export function getHoliday(holidayKey: any, ethYear: any, options?: {}): {
key: any;
tags: any;
movable: boolean;
name: any;
description: any;
ethiopian: {
year: any;
month: any;
day: any;
};
gregorian?: undefined;
} | {
key: any;
tags: any;
movable: boolean;
name: any;
description: any;
ethiopian: any;
gregorian: any;
};
export function getHolidaysInMonth(ethYear: any, ethMonth: any, options?: {}): any[];
export function getHolidaysForYear(ethYear: any, options?: {}): any[];
export default Kenat;
import { Kenat } from './Kenat.js';
import { toEC } from './conversions.js';
import { toGC } from './conversions.js';
import { toArabic } from './geezConverter.js';
import { toGeez } from './geezConverter.js';
import { getHolidaysInMonth } from './holidays.js';
import { getHolidaysForYear } from './holidays.js';
import { getBahireHasab } from './bahireHasab.js';
import { getFastingPeriod } from './fasting.js';
import { getFastingInfo } from './fasting.js';
import { getFastingDays } from './fasting.js';
import { MonthGrid } from './MonthGrid.js';
import { Time } from './Time.js';
import { getHoliday } from './holidays.js';
import { HolidayTags } from './constants.js';
import { monthNames } from './constants.js';
export { toEC, toGC, toArabic, toGeez, getHolidaysInMonth, getHolidaysForYear, getBahireHasab, getFastingPeriod, getFastingInfo, getFastingDays, MonthGrid, Time, getHoliday, HolidayTags, monthNames };
/**
* Kenat - Ethiopian Calendar Date Wrapper
*
* A lightweight class to work with both Gregorian and Ethiopian calendars.
* It wraps JavaScript's built-in `Date` object and converts Gregorian dates to Ethiopian equivalents.
*
*/
export class Kenat {
/**
* Creates and returns a new instance of the Kenat class representing the current moment.
*
* @returns {Kenat} A new Kenat instance set to the current date and time.
*/
static now(): Kenat;
static getMonthCalendar(year: any, month: any, options?: {}): {
month: any;
monthName: any;
year: any;
headers: any;
days: any[];
};
/**
* Generates a full-year calendar as an array of month objects for the specified year.
*
* @param {number} year - The year for which to generate the calendar.
* @param {Object} [options={}] - Optional configuration for calendar generation.
* @param {boolean} [options.useGeez=false] - Whether to use the Geez calendar system.
* @param {string} [options.weekdayLang='amharic'] - Language for weekday names (e.g., 'amharic').
* @param {number} [options.weekStart=0] - The starting day of the week (0 = Sunday, 1 = Monday, etc.).
* @param {function|null} [options.holidayFilter=null] - Optional filter function for holidays.
* @returns {Array<Object>} An array of 13 month objects, each containing:
* - {number} month: The month number (1-13).
* - {string} monthName: The name of the month.
* - {number} year: The year of the month.
* - {Array<string>} headers: The headers for the days of the week.
* - {Array<Array<Object>>} days: The grid of day objects for the month.
*/
static getYearCalendar(year: number, options?: {
useGeez?: boolean;
weekdayLang?: string;
weekStart?: number;
holidayFilter?: Function | null;
}): Array<any>;
/**
* Generates an array of Kenat instances for a given date range.
* @param {Kenat} startDate - The start of the range.
* @param {Kenat} endDate - The end of the range.
* @returns {Kenat[]} An array of Kenat objects.
* @throws {InvalidInputTypeError} If start or end dates are not Kenat instances.
*/
static generateDateRange(startDate: Kenat, endDate: Kenat): Kenat[];
/**
* Constructs a Kenat instance.
* Can be initialized with:
* - An Ethiopian date string (e.g., '2016/1/1', '2016-1-1').
* - An object with { year, month, day }.
* - A native JavaScript Date object (will be converted from Gregorian).
* - No arguments, for the current date.
*
* @param {string|Object|Date} [input] - The date input.
* @param {Object} [timeObj] - An optional time object.
* @throws {InvalidEthiopianDateError} If the provided Ethiopian date is invalid.
* @throws {InvalidDateFormatError} If the provided date string format is invalid.
* @throws {UnrecognizedInputError} If the input format is unrecognized.
*/
constructor(input?: string | any | Date, timeObj?: any);
time: Time;
ethiopian: {
year: any;
month: any;
day: any;
};
/**
* Converts the current Ethiopian date stored in this.ethiopian to its Gregorian equivalent.
*
* @returns {{ year: number, month: number, day: number }} The Gregorian date corresponding to the Ethiopian date.
*/
getGregorian(): {
year: number;
month: number;
day: number;
};
/**
* Returns the Ethiopian equivalent of the stored Gregorian date.
*
* @returns {{ year: number, month: number, day: number }} An object representing the Ethiopian date.
*/
getEthiopian(): {
year: number;
month: number;
day: number;
};
/**
* Sets the current time.
*
* @param {number} hour - The hour value to set.
* @param {number} minute - The minute value to set.
* @param {string} period - The period of the day (e.g., 'AM' or 'PM').
*/
setTime(hour: number, minute: number, period: string): void;
/**
* Calculates and returns the Bahire Hasab values for the current instance's year.
*
* @returns {Object} An object containing all the calculated Bahire Hasab values
* (ameteAlem, evangelist, wenber, metqi, nineveh, etc.).
*/
getBahireHasab(): any;
/**
* Returns a string representation of the Ethiopian date and time.
*
* The format is: "Ethiopian: {year}-{month}-{day} {hh:mm period}".
* If the time is not available, hour and minute are replaced with '??'.
*
* @returns {string} The formatted Ethiopian date and time string.
*/
toString(): string;
/**
* Formats the Ethiopian date according to the specified options.
*
* @param {Object} [options={}] - Formatting options.
* @param {string} [options.lang='amharic'] - Language to use for formatting ('amharic', 'english', etc.).
* @param {boolean} [options.showWeekday=false] - Whether to include the weekday in the formatted string.
* @param {boolean} [options.useGeez=false] - Whether to use Geez numerals (only applies if lang is 'amharic').
* @param {boolean} [options.includeTime=false] - Whether to include the time in the formatted string.
* @returns {string} The formatted Ethiopian date string.
*/
format(options?: {
lang?: string;
showWeekday?: boolean;
useGeez?: boolean;
includeTime?: boolean;
}): string;
/**
* Formats the Ethiopian date in Geez numerals and Amharic month name.
*
* @returns {string} The formatted date string in the format: "{Amharic Month Name} {Geez Day} {Geez Year}".
*
* formatInGeezAmharic(); // "የካቲት ፲ ፳፻፲፭"
*/
formatInGeezAmharic(): string;
/**
* Formats the Ethiopian date with weekday name.
*
* @param {'amharic'|'english'} [lang='amharic'] - Language for month and weekday names.
* @param {boolean} [useGeez=false] - Whether to show numerals in Geez.
* @returns {string} Formatted string with weekday, e.g. "ማክሰኞ, መስከረም ፳፩ ፳፻፲፯"
*/
formatWithWeekday(lang?: "amharic" | "english", useGeez?: boolean): string;
/**
* Returns the Ethiopian date in "yyyy/mm/dd" short format.
* @returns {string}
*/
formatShort(): string;
/**
* Returns an ISO-style date string: "YYYY-MM-DD" or "YYYY-MM-DDTHH:mm".
* @returns {string}
*/
toISOString(): string;
/**
* Checks if the current date is a holiday.
* @param {Object} [options={}] - Options for language.
* @param {string} [options.lang='amharic'] - The language for the holiday names and descriptions.
* @returns {Array<Object>} An array of holiday objects for the current date, or an empty array if it's not a holiday.
*/
isHoliday(options?: {
lang?: string;
}): Array<any>;
/**
* Generates a calendar for a given Ethiopian month and year, mapping each Ethiopian date
* to its corresponding Gregorian date and providing formatted display strings.
*
* @param {number} [year=this.ethiopian.year] - The Ethiopian year for the calendar.
* @param {number} [month=this.ethiopian.month] - The Ethiopian month (1-13).
* @param {boolean} [useGeez=false] - Whether to display dates in Geez numerals.
* @returns {Array<Object>} An array of objects, each representing a day in the month with
* Ethiopian and Gregorian date information and display strings.
*/
getMonthCalendar(year?: number, month?: number, useGeez?: boolean): Array<any>;
/**
* Prints the calendar grid for the current Ethiopian month.
*
* @param {boolean} [useGeez=false] - If true, displays the calendar using Geez numerals.
* @returns {void}
*/
printThisMonth(useGeez?: boolean): void;
/**
* Adds a specified number of days to the current Ethiopian date.
*
* @param {number} days - The number of days to add.
* @returns {Kenat} A new Kenat instance representing the updated date.
*/
addDays(days: number): Kenat;
/**
* Returns a new Kenat instance with the date advanced by the specified number of months.
*
* @param {number} months - The number of months to add to the current date.
* @returns {Kenat} A new Kenat instance representing the updated date.
*/
addMonths(months: number): Kenat;
/**
* Returns a new Kenat instance with the year increased by the specified number of years.
*
* @param {number} years - The number of years to add to the current date.
* @returns {Kenat} A new Kenat instance representing the updated date.
*/
addYears(years: number): Kenat;
/**
* Calculates the difference in days between this object's Ethiopian date and another object's Ethiopian date.
*
* @param {Object} other - An object with a `getEthiopian` method that returns an Ethiopian date.
* @returns {number} The number of days difference between the two Ethiopian dates.
*/
diffInDays(other: any): number;
/**
* Calculates the difference in months between this instance's Ethiopian date and another Ethiopian date.
*
* @param {Object} other - An object with a `getEthiopian` method that returns an Ethiopian date.
* @returns {number} The number of months difference between the two Ethiopian dates.
*/
diffInMonths(other: any): number;
/**
* Calculates the difference in years between this instance's Ethiopian date and another.
*
* @param {Object} other - An object with a getEthiopian() method returning an Ethiopian date.
* @returns {number} The number of years difference between the two Ethiopian dates.
*/
diffInYears(other: any): number;
getCurrentTime(): Time;
/**
* Checks if the current Kenat instance's date is before another Kenat instance's date.
* @param {Kenat} other - The other Kenat instance to compare against.
* @returns {boolean} True if the current date is before the other date.
*/
isBefore(other: Kenat): boolean;
/**
* Checks if the current Kenat instance's date is after another Kenat instance's date.
* @param {Kenat} other - The other Kenat instance to compare against.
* @returns {boolean} True if the current date is after the other date.
*/
isAfter(other: Kenat): boolean;
/**
* Checks if the current Kenat instance's date is the same as another Kenat instance's date.
* @param {Kenat} other - The other Kenat instance to compare against.
* @returns {boolean} True if the dates are the same.
*/
isSameDay(other: Kenat): boolean;
/**
* Returns a new Kenat instance set to the first day of the current month.
* @returns {Kenat} A new Kenat instance.
*/
startOfMonth(): Kenat;
/**
* Returns a new Kenat instance set to the last day of the current month.
* @returns {Kenat} A new Kenat instance.
*/
endOfMonth(): Kenat;
/**
* Checks if the current Ethiopian year is a leap year.
* @returns {boolean} True if it is a leap year.
*/
isLeapYear(): boolean;
/**
* Returns the weekday number for the current date.
* @returns {number} The day of the week (0 for Sunday, 6 for Saturday).
*/
weekday(): number;
}
import { Time } from './Time.js';
export class MonthGrid {
static create(config?: {}): {
headers: any;
days: any[];
year: any;
month: any;
monthName: any;
up: () => /*elided*/ any;
down: () => /*elided*/ any;
};
constructor(config?: {});
year: any;
month: any;
weekStart: any;
useGeez: any;
weekdayLang: any;
holidayFilter: any;
mode: any;
showAllSaints: any;
_validateConfig(config: any): void;
generate(): {
headers: any;
days: any[];
year: any;
month: any;
monthName: any;
up: () => {
headers: any;
days: any[];
year: any;
month: any;
monthName: any;
up: /*elided*/ any;
down: () => /*elided*/ any;
};
down: () => {
headers: any;
days: any[];
year: any;
month: any;
monthName: any;
up: () => /*elided*/ any;
down: /*elided*/ any;
};
};
_getRawDays(): any[];
_getFilteredHolidays(): any[];
_getSaintsMap(): {};
_mergeDays(rawDays: any, holidaysList: any, saintsMap: any): any[];
_getWeekdayHeaders(): any;
_getLocalizedMonthName(): any;
_getLocalizedYear(): any;
up(): this;
down(): this;
}

Sorry, the diff of this file is too big to display

export function printMonthCalendarGrid(ethiopianYear: any, ethiopianMonth: any, calendarData: any, useGeez?: boolean): void;
export class Time {
/**
* Creates a Time instance from a Gregorian 24-hour time.
* @param {number} hour - The Gregorian hour (0-23).
* @param {number} [minute=0] - The minute (0-59).
* @returns {Time} A new Time instance.
* @throws {InvalidTimeError} If the Gregorian time is invalid.
*/
static fromGregorian(hour: number, minute?: number): Time;
/**
* Creates a `Time` object from a string representation.
*
* This static method parses a time string, which can include hours, minutes, and an optional period (day/night).
* It supports both Arabic numerals (e.g., "1", "30") and Ethiopic numerals (e.g., "፩", "፴") for hours and minutes,
* assuming a `toArabic` utility function is available to convert Ethiopic numerals to Arabic numbers.
*
* The time string must contain a colon (`:`) separating the hour and minute.
*
* @static
* @param {string} timeString - The string representation of the time.
* Expected formats:
* - "HH:MM" (e.g., "6:30", "፮:፴")
* - "HH:MM period" (e.g., "6:30 night", "፮:፴ ማታ")
* Where:
* - HH: Hour (Arabic or Ethiopic numeral).
* - MM: Minute (Arabic or Ethiopic numeral).
* - period: Optional. Case-insensitive. Recognized values are "night" or "ማታ".
* If the period is omitted, or if a third part is present but not recognized as "night" or "ማታ",
* the time is assumed to be in the 'day' period.
*
* @returns {Time} A new `Time` object representing the parsed time.
*
* @throws {InvalidTimeError} If the `timeString` is:
* - Not a string or an empty string.
* - Missing the colon (`:`) separator.
* - Formatted incorrectly (e.g., not enough parts after splitting).
* - Contains non-numeric values for hour or minute that cannot be parsed into numbers
* (neither as Arabic nor as Ethiopic numerals via `toArabic`).
*
*/
static fromString(timeString: string): Time;
/**
* Constructs a Time instance representing an Ethiopian time.
* @param {number} hour - The Ethiopian hour (1-12).
* @param {number} [minute=0] - The minute (0-59).
* @param {string} [period='day'] - The period ('day' or 'night').
* @throws {InvalidTimeError} If any time component is invalid.
*/
constructor(hour: number, minute?: number, period?: string);
hour: number;
minute: number;
period: string;
/**
* Converts the Ethiopian time to Gregorian 24-hour format.
* @returns {{hour: number, minute: number}}
*/
toGregorian(): {
hour: number;
minute: number;
};
/**
* Adds a duration to the current time.
* @param {{hours?: number, minutes?: number}} duration - Object with hours and/or minutes to add.
* @returns {Time} A new Time instance with the added duration.
*/
add(duration: {
hours?: number;
minutes?: number;
}): Time;
/**
* Subtracts a duration from the current time.
* @param {{hours?: number, minutes?: number}} duration - Object with hours and/or minutes to subtract.
* @returns {Time} A new Time instance with the subtracted duration.
*/
subtract(duration: {
hours?: number;
minutes?: number;
}): Time;
/**
* Calculates the difference between this time and another.
* @param {Time} otherTime - Another Time instance to compare against.
* @returns {{hours: number, minutes: number}} An object with the absolute difference.
*/
diff(otherTime: Time): {
hours: number;
minutes: number;
};
/**
* Formats the time as a string.
* @param {Object} [options] - Formatting options.
* @param {string} [options.lang] - The language for the period label. Defaults to 'english' if useGeez is false, otherwise 'amharic'.
* @param {boolean} [options.useGeez=true] - Whether to use Ge'ez numerals.
* @param {boolean} [options.showPeriodLabel=true] - Whether to show the period label.
* @param {boolean} [options.zeroAsDash=true] - Whether to represent zero minutes as a dash.
* @returns {string} The formatted time string.
*/
format(options?: {
lang?: string;
useGeez?: boolean;
showPeriodLabel?: boolean;
zeroAsDash?: boolean;
}): string;
}
/**
* Validates that all provided date parts are numbers.
* @param {string} funcName - The name of the function being validated.
* @param {Object} dateParts - An object where keys are param names and values are the inputs.
* @throws {InvalidInputTypeError} if any value is not a number.
*/
export function validateNumericInputs(funcName: string, dateParts: any): void;
/**
* Validates that the input is a valid Ethiopian date object.
* @param {Object} dateObj - The object to validate.
* @param {string} funcName - The name of the function being validated.
* @param {string} paramName - The name of the parameter being validated.
* @throws {InvalidInputTypeError} if the object is invalid.
*/
export function validateEthiopianDateObject(dateObj: any, funcName: string, paramName: string): void;
/**
* Validates that the input is a valid Ethiopian time object.
* @param {Object} timeObj - The object to validate.
* @param {string} funcName - The name of the function being validated.
* @param {string} paramName - The name of the parameter being validated.
* @throws {InvalidInputTypeError} if the object is invalid.
*/
export function validateEthiopianTimeObject(timeObj: any, funcName: string, paramName: string): void;
/**
* Calculates the day of the year for a given date.
*
* @param {number} year - The full year (e.g., 2024).
* @param {number} month - The month (1-based, January is 1, December is 12).
* @param {number} day - The day of the month.
* @returns {number} The day of the year (1-based).
*/
export function dayOfYear(year: number, month: number, day: number): number;
/**
* Convert a day of year to Gregorian month and day.
*/
export function monthDayFromDayOfYear(year: any, dayOfYear: any): {
month: number;
day: any;
};
/**
* Checks if the given Gregorian year is a leap year.
*
* Gregorian leap years occur every 4 years, except centuries not divisible by 400.
* For example: 2000 is a leap year, 1900 is not.
*
* @param {number} year - Gregorian calendar year (e.g., 2025)
* @returns {boolean} - True if the year is a leap year, otherwise false.
*/
export function isGregorianLeapYear(year: number): boolean;
/**
* Checks if the given Ethiopian year is a leap year.
*
* Ethiopian leap years occur every 4 years, when the year modulo 4 equals 3.
* This means years like 2011, 2015, 2019 (in Ethiopian calendar) are leap years.
*
* @param {number} year - Ethiopian calendar year (e.g., 2011)
* @returns {boolean} - True if the year is a leap year, otherwise false.
*/
export function isEthiopianLeapYear(year: number): boolean;
/**
* Returns the number of days in the given Ethiopian month and year.
* @param {number} year - Ethiopian year
* @param {number} month - Ethiopian month (1-13)
* @returns {number} Number of days in the month
*/
export function getEthiopianDaysInMonth(year: number, month: number): number;
/**
* Returns the weekday (0-6) for a given Ethiopian date.
*
* @param {Object} param0 - The Ethiopian date.
* @param {number} param0.year - The Ethiopian year.
* @param {number} param0.month - The Ethiopian month (1-13).
* @param {number} param0.day - The Ethiopian day (1-30).
* @returns {number} The day of the week (0 for Sunday, 6 for Saturday).
*/
export function getWeekday({ year, month, day }: {
year: number;
month: number;
day: number;
}): number;
/**
* Checks if a given Ethiopian date is valid.
* @param {number} year - Ethiopian year
* @param {number} month - Ethiopian month (1-13)
* @param {number} day - Ethiopian day (1-30 or 1-5/6)
* @returns {boolean} - True if the date is valid, otherwise false.
*/
export function isValidEthiopianDate(year: number, month: number, day: number): boolean;
/**
* Helper: Get Ethiopian New Year for a Gregorian year.
* @param {number} gYear - The Gregorian year.
* @returns {{gregorianYear: number, month: number, day: number}}
* @throws {InvalidInputTypeError} If gYear is not a number.
*/
export function getEthiopianNewYearForGregorian(gYear: number): {
gregorianYear: number;
month: number;
day: number;
};
/**
* Returns the Gregorian date of the Ethiopian New Year for the given Ethiopian year.
*
* @param {number} ethiopianYear - Ethiopian calendar year.
* @returns {{gregorianYear: number, month: number, day: number}}
* @throws {InvalidInputTypeError} If ethiopianYear is not a number.
*/
export function getGregorianDateOfEthiopianNewYear(ethiopianYear: number): {
gregorianYear: number;
month: number;
day: number;
};
+12
-3
{
"name": "kenat",
"version": "2.3.0",
"version": "3.0.0",
"description": "A JavaScript library for the Ethiopian calendar with date and time support.",

@@ -12,3 +12,4 @@ "main": "src/index.js",

"release:minor": "npm version minor && git push && git push --tags && npm publish",
"release:major": "npm version major && git push && git push --tags && npm publish"
"release:major": "npm version major && git push && git push --tags && npm publish",
"prepack": "tsc -p tsconfig.json"
},

@@ -40,2 +41,9 @@ "keywords": [

"license": "MIT",
"types": "./types/index.d.ts",
"exports": {
".": {
"types": "./types/index.d.ts",
"import": "./src/index.js"
}
},
"repository": {

@@ -51,4 +59,5 @@ "type": "git",

"jest": "^29.7.0",
"jsdoc": "^4.0.4"
"jsdoc": "^4.0.4",
"typescript": "^5.9.2"
}
}