jewish-calendar
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Jewish Calendar

npm package Build Status Downloads Issues Code Coverage Semantic Release

A comprehensive TypeScript library for Jewish calendar calculations, date conversions, and Zmanim (Jewish time calculations).

Features

  • Convert between Gregorian and Hebrew dates
  • Calculate Jewish holidays and special dates
  • Determine Zmanim (halachic times) for any location
  • Support for Parsha of the week calculations
  • Hebrew date formatting
  • Comprehensive handling of Jewish calendar rules
  • Written in TypeScript with full type safety
  • Well-documented API
  • Thoroughly tested

Install

npm install jewish-calendar

Usage

import { HebrewDate, GregorianDate, Zmanim } from 'jewish-calendar';

// Convert Gregorian to Hebrew date
const hebrewDate = HebrewDate.fromGregorian(new Date());
console.log(hebrewDate.toString()); // Returns Hebrew date in English or Hebrew

// Get Zmanim for a location
const zmanim = new Zmanim({
  latitude: 31.7767,
  longitude: 35.2345,
  elevation: 754,
  timeZone: 'Asia/Jerusalem'
});
console.log(zmanim.getSunrise()); // Get sunrise time
console.log(zmanim.getSunset());  // Get sunset time

// Get upcoming holidays
const holidays = HebrewDate.getUpcomingHolidays();

API

HebrewDate

fromGregorian(date: Date): HebrewDate

Converts a Gregorian date to a Hebrew date.

toGregorian(): Date

Converts a Hebrew date to a Gregorian date.

Zmanim

constructor(options: ZmanimOptions)

Creates a new Zmanim calculator with the specified location options.

getSunrise(): Date

getSunset(): Date

getCandleLighting(): Date

getHavdalah(): Date

And many more methods for various halachic times.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Make sure to read the contributing guidelines first.

License

MIT © Dovid

Package Sidebar

Install

npm i jewish-calendar

Weekly Downloads

45

Version

2.0.1

License

MIT

Unpacked Size

10.9 kB

Total Files

15

Last publish

Collaborators

  • davidmoshecrow