Socket
Socket
Sign inDemoInstall

com.github.sameerparekh:holidays_2.12

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.sameerparekh:holidays_2.12

holidays


Version published
Maintainers
1
Source

Holidays

Build Status

A simple library to check if a date is a holiday.

Installation

Add the following to your sbt build (Scala 2.12.x):

libraryDependencies += "com.github.sameerparekh" %% "holidays" % "0.1.1"

Usage

  • Import the library.
  • Configure an implicit holiday list (HolidayList)
  • Check your LocalDate to see if it is a holiday.
import com.github.sameerparekh.holidays._
import org.joda.time.LocalDate

implicit val holidayList: HolidayList = USAFederalHolidays

println {
  if (LocalDate.now().isHoliday) "Today is a holiday" 
  else "Today is not a holiday"
}

Extension

Pull requests welcome.

Add a holiday

  • Create a new instance of a HolidayFromYear, which is a function from a year to a LocalDate. A number of helper functions are available.

Add a new holiday list

  • Create a new instance of a HolidayList, which is a set of HolidayFromYear.

FAQs

Package last updated on 23 May 2019

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc