Package Exports
- turkish-holidays-lib
- turkish-holidays-lib/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (turkish-holidays-lib) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Turkey Public Holidays
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-libUsage
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 DayAPI 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.