convert date-time values between Ethiopian and European/Gregorian calendar.
Ethiopian calendar is unique for having 13 months, 12 months each with 30 days and 1 more month with 5 or 6 days. It is also 7/8 years behind the European/Gregorian calendar. This library contains javascript code (node/browser) for conversion of the date formats back and forth.
yarn add ethiopian-calendar-date-converter
npm i -S ethiopian-calendar-date-converter
<script
type="text/javascript"
src="https://unpkg.com/ethiopian-calendar-date-converter@2"
></script>
import { EthDateTime, limits } from 'ethiopian-calendar-date-converter'
// Create a date instance from current date-time
const ethDateTime = EthDateTime.now()
// Convert to Ethiopian date
const ethDateTime = EthDateTime.fromEuropeanDate(dateInput)
// Convert from Ethiopian date
const ethDateTime = new EthDateTime(
2012, // year (in Ethioian Calendar)
2, // month of year (second month of year, in Ethioian Calendar)
29, // day of month (in Ethioian Calendar)
1, // hour (in Ethioian Time format)
52, // minute (in Ethioian Time format)
52, // second (in Ethioian Time format)
)
const date = ethDateTime.toEuropeanDate()
// get `limits` import to get minimum and maximum dat values that can be processed
A sample web application using this library can be accessed at https://ethiopian-calendar.netlify.app
This project is licensed under the MIT license.