New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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.

  • 2.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-78.57%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc