2.1.4 • Published 26 days ago

ethiopian-calendar-date-converter v2.1.4

Weekly downloads
6
License
MIT
Repository
github
Last release
26 days ago

Ethio-European Date Converter

convert date-time values between Ethiopian and European/Gregorian calendar.


build and test Version License FOSSA Status

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.

Install

Yarn

yarn add ethiopian-calendar-date-converter

npm

npm i -S ethiopian-calendar-date-converter

cdn

<script
  type="text/javascript"
  src="https://unpkg.com/ethiopian-calendar-date-converter@2"
></script>

Usage

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

Demo

A sample web application using this library can be accessed at https://ethiopian-calendar.netlify.app

License

This project is licensed under the MIT license.

2.1.4

26 days ago

2.1.3

5 months ago

2.1.2

10 months ago

2.0.2

1 year ago

2.0.1

1 year ago

1.0.2

4 years ago

1.0.0

4 years ago

0.0.2

4 years ago