🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

turkish-holidays-lib

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turkish-holidays-lib

This library calculates public holidays of Turkey.

latest
npmnpm
Version
2.0.2
Version published
Weekly downloads
57
78.13%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

holidays

FAQs

Package last updated on 27 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts