2.0.2 • Published 2 months ago

turkish-holidays-lib v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

Turkey Public Holidays

npm version license Buy me a beer: https://patreon.com/GalacticBanana702

A utility library to calculate Turkey's public holidays based on the Gregorian calendar and Islamic Hijri calendar.

Installation

You can install the package using npm:

npm install turkish-holidays-lib

Usage

import TurkeyPublicHoliday from 'turkish-holidays-lib';

const turkeyHolidays = new TurkeyPublicHoliday();

const year = 2023;

const holidayNames = turkeyHolidays.publicHolidayNames(year);
console.log(holidayNames);

const publicHolidays = turkeyHolidays.publicHolidays(year);
console.log(publicHolidays);

const isHoliday = turkeyHolidays.isPublicHoliday(new Date(2023, 0, 2));
console.log(isHoliday); // Should return true for New Year's Day

API Reference

publicHolidayNames(year: number): Map<Date, string>

Returns a Map of public holiday dates and their corresponding names for the given year.

publicHolidays(year: number): Date[]

Returns an array of public holiday dates for the given year.

isPublicHoliday(dt: Date): boolean

Checks if the given date is a public holiday.

List of Supported Holidays

  • New Year's Day
  • National Sovereignty and Children's Day
  • Labour and Solidarity Day
  • Ramadan Bayram (Eid al-Fitr) Days
  • Youth and Sports Day
  • Feast of Sacrifice (Kurban Bayram) Days
  • Victory Day
  • Republic Day
  • Democracy and National Unity Day (Since 2017)

License

This project is licensed under the MIT License.


1.0.9

2 months ago

1.0.8

9 months ago

2.0.2

2 months ago

2.0.1

2 months ago

2.0.0

2 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago