v2.0.0
Description:
a major enhancement to the library by adding a complete, authentic Bahire Hasab (ባሕረ ሃሳብ) calculation engine and a powerful new API for querying and filtering holidays. This makes kenat
a more comprehensive and robust tool for developers building applications that require deep Ethiopian calendar and liturgical context.
✨ Key Changes
1. Bahire Hasab Calculation Engine (/src/bahireHasab.js
)
- A new, self-contained module has been created to handle all traditional calculations based on the Bahire Hasab system.
- It accurately computes foundational values like
Amete Alem
,Wenber
,Metqi
, and the date ofNineveh
. - This module is now the single source of truth for all movable feast calculations, ensuring authenticity and maintainability.
2. Advanced Holiday API
getHoliday(holidayKey, year, options)
: A new top-level function to fetch a single, fully-detailed holiday object for a given year.getHolidaysForYear(year, options)
: A new convenience function to get a complete, sorted list of all holidays (fixed and movable) for an entire year..isHoliday()
Method: A new method on theKenat
class instance to easily check if any specific date is a holiday.new Kenat('2017/1/17').isHoliday()
.getBahireHasab()
Method: A new method on theKenat
class that returns a rich object containing all calculated Bahire Hasab values and the dates of all movable feasts for that year.
3. Powerful Holiday Filtering
- The
getHolidaysInMonth
,getHolidaysForYear
, andMonthGrid
functions now accept afilter
option. - Developers can easily request only the holidays they need by providing a single tag (e.g.,
{ filter: 'public' }
) or an array of tags ({ filter: ['christian', 'muslim'] }
). - The
HolidayTags
object is now exported, allowing for safe and readable filtering.
4. Internationalization (i18n) & Data Refactoring
- Full i18n for Holidays: All holiday names and descriptions have been moved to a centralized
holidayInfo
constant, allowing for easy translation and maintenance. - Bahire Hasab i18n: The
.getBahireHasab()
method now accepts alang
option and returns translated names for the Evangelist and New Year's Day. - DRY Principle: The core calculation logic in
bahireHasab.js
has been refactored into a single internal "engine" to avoid code duplication and improve maintainability.
5. Bug Fixes
- The logic for calculating Islamic holidays has been completely rewritten to correctly handle cases where holidays (like Moulid) can occur twice in the same Ethiopian solar year.
- Fixed a circular dependency between the
Kenat
andbahireHasab
modules.
This update significantly enhances the library's capabilities, making it a more powerful, convenient, and authentic resource for Ethiopian calendar development.