ProductPromotion
Logo

Clojure

made by https://0x3d.site

GitHub - luciolucio/holi: A library for calendar operations that are aware of weekends and holidays
A library for calendar operations that are aware of weekends and holidays - luciolucio/holi
Visit Site

GitHub - luciolucio/holi: A library for calendar operations that are aware of weekends and holidays

GitHub - luciolucio/holi: A library for calendar operations that are aware of weekends and holidays

Holi

A library for calendar operations that are aware of weekends and holidays

build Clojars Project cljdoc badge

Examples

(ns my-app
  (:require [luciolucio.holi :as holi]
            [tick.core :as t]))

;      July 2019
; Su Mo Tu We Th Fr Sa
;     1  2  3  4  5  6
;  7  8  9 10 11 12 13
; 14 15 16 17 18 19 20
; 21 22 23 24 25 26 27
; 28 29 30 31

(holi/add (t/date "2019-07-12") 3 :business-days) ; 2020-07-17 (skips weekends)
(holi/add (t/date "2019-07-03") 1 :business-days "US") ; 2019-07-05 (skips 4th of July as a US holiday)

(holi/weekend? (t/date "2019-07-06")) ; -> true
(holi/holiday? (t/date "2019-07-04") "US") ; -> true

Use of juxt/tick is not required (but highly recommended).

Features

  • Standard calendar operations (e.g. add 5 days) that are aware of weekends and holidays to skip those when requested
  • Boolean fns that check individual dates (weekend?, holiday?, business-day? and non-business-day?)
  • List holidays for a certain year, or a specific date
  • Non-standard weekends (supports sat/sun and fri/sat)
  • Clojure and ClojureScript
  • Customize holidays if needed

Disclaimer

Holidays in holi have been put together to the best of the author's knowledge, and are not guaranteed to be neither correct, complete nor historically accurate. You are encouraged to double-check the calendar showcase, the .hol files and perhaps the source to see if the calendar you want to use fits your use case. If you think there's a mistake in a calendar, see I found a problem below.

Install

Import the latest version from Clojars into your project dependencies.

ClojureScript is supported, but holi has only been tested when built with shadow-cljs and run on a browser. It should still work otherwise, but if you have issues with other setups feel free to hit me up on Slack: @Lucio Assis

Docs

Full holi documentation

I found a problem

Contribute a fix, or a new calendar to the project - see CONTRIBUTING.md. You can also just let me know on Slack: @Lucio Assis and I'll try my best to fix it timely.

I want custom holidays

Learn how to build yourself a custom library, with your own holiday calendars.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory