Giter Club home page Giter Club logo

workalendar's Introduction

Workalendar

license pypi conda

Overview

Workalendar is a Python module that offers classes able to handle calendars, list legal / religious holidays and gives working-day-related computation functions.

Installation

With pip

pip install workalendar

With conda

conda install -c conda-forge workalendar

Extra dependencies

Note: NEW in v16.0.0

If the calendar(s) you want to work with requires astronomical computations (such as Asian calendars needing equinoxes or solar terms), Workalendar will provide pre-computed values within the year range from 1991 to 2051.

However, if you want to use astronomical libraries to compute the calendar yourself, you'll need to install the [astronomy] extra dependency like this:

pip install workalendar[astronomy]

If you had previously installed the skyfield and skyfield-data packages, they'll be used to compute the calendars. If you want to benefit from the "astronomical cache", and eventually benefit from performance gains, you'll have to uninstall those packages first to fallback to pre-computed files.

Status

This library is ready for production, although we may warn eventual users: some calendars may not be up-to-date, and this library doesn't cover all the existing countries on earth (yet).

If you spot any bug or wish to add a calendar, please refer to the Contributing doc.

Usage sample

>>> from datetime import date
>>> from workalendar.europe import France
>>> cal = France()
>>> cal.holidays(2012)
[(datetime.date(2012, 1, 1), 'New year'),
 (datetime.date(2012, 4, 9), 'Easter Monday'),
 (datetime.date(2012, 5, 1), 'Labour Day'),
 (datetime.date(2012, 5, 8), 'Victory in Europe Day'),
 (datetime.date(2012, 5, 17), 'Ascension Day'),
 (datetime.date(2012, 5, 28), 'Whit Monday'),
 (datetime.date(2012, 7, 14), 'Bastille Day'),
 (datetime.date(2012, 8, 15), 'Assumption of Mary to Heaven'),
 (datetime.date(2012, 11, 1), "All Saints' Day"),
 (datetime.date(2012, 11, 11), 'Armistice Day'),
 (datetime.date(2012, 12, 25), 'Christmas')]
>>> cal.is_working_day(date(2012, 12, 25))  # it's Christmas
False
>>> cal.is_working_day(date(2012, 12, 30))  # it's Sunday
False
>>> cal.is_working_day(date(2012, 12, 26))
True
>>> cal.add_working_days(date(2012, 12, 23), 5)  # 5 working days after Xmas
datetime.date(2012, 12, 31)

For a more complete documentation and advanced usage, go to the official workalendar documentation.

External dependencies

Workalendar will require you to use Python 3.7+.

Workalendar is tested on Python 3.7, 3.8, 3.9, 3.10, 3.11, and on Linux (Ubuntu), Mac OS and Windows using Github actions.

Conditional dependencies

As of v15.0.0:

  • If you're using *Nix and Python 3.7, 3.8, the package backports.zoneinfo is required
  • If you're using Windows and Python 3.7, 3.8, the package tzdata is also a requirement (with the backports.zoneinfo).
  • If you're using Python 3.9+, the stdlib zoneinfo package will be used.

Tests

CI status:

Github action status

To run test, just install tox with pip install tox and run:

tox

from the command line.

Available Calendars

Europe

  • Austria
  • Belarus
  • Belgium
  • Bulgaria
  • Cayman Islands
  • Croatia
  • Cyprus
  • Czech Republic
  • Denmark
  • Estonia
  • European Central Bank
  • Finland
  • France
  • France (Alsace / Moselle)
  • Georgia
  • Germany
  • Greece
  • Guernsey
  • Hungary
  • Iceland
  • Ireland
  • Italy
  • Latvia
  • Lithuania
  • Luxembourg
  • Malta
  • Monaco
  • Netherlands (optionally with school holidays and carnival)
  • Norway
  • Poland
  • Portugal
  • Romania
  • Russia
  • Serbia
  • Slovakia
  • Slovenia
  • Spain (Andalusia, Aragon, Castile and León, Castilla-La Mancha, Canary Islands, Extremadura, Galicia, Balearic Islands, La Rioja, Community of Madrid, Murcia, Navarre, Asturias, Basque Country, Cantabria, Valencian Community)
  • Sweden
  • Switzerland (Aargau, Appenzell Innerrhoden, Appenzell Ausserrhoden, Bern, Basel-Landschaft, Basel-Stadt, Fribourg, Geneva, Glarus, Graubünden, Jura, Luzern, Neuchâtel, Nidwalden, Obwalden, St. Gallen, Schaffhausen, Solothurn, Schwyz, Thurgau, Ticino, Uri, Vaud, Valais, Zug, Zurich)
  • Turkey
  • Ukraine
  • United Kingdom (incl. Northern Ireland, Scotland and all its territories)

America

  • Argentina
  • Barbados
  • Brazil (all states, cities and for bank transactions, except the city of Viana)
  • Canada (including provincial and territory holidays)
  • Chile
  • Colombia
  • El Salvador
  • Mexico
  • Panama
  • Paraguay
  • United States of America
    • State holidays for all the 50 States
    • American Samoa
    • Chicago, Illinois
    • Guam
    • Suffolk County, Massachusetts
    • California Education, Berkeley, San Francisco, West Hollywood
    • Florida Legal and Florida Circuit Courts, Miami-Dade
    • Federal Reserve System

Asia

  • China
  • Hong Kong
  • Israel
  • Japan
  • JapanBank
  • Kazakhstan
  • Malaysia
  • Philippines
  • Qatar
  • Singapore
  • South Korea
  • Taiwan

Oceania

  • Australia (incl. its different states)
  • Marshall Islands
  • New Zealand

Africa

  • Algeria
  • Angola
  • Benin
  • Ivory Coast
  • Kenya
  • Madagascar
  • Mozambique
  • Nigeria
  • São Tomé
  • South Africa
  • Tunisia

And more to come (I hope!)

Caveats

Please take note that some calendars are not 100% accurate. The most common example is the Islamic calendar, where some computed holidays are not exactly on the same official day decided by religious authorities, and this may vary country by country. Whenever it's possible, try to adjust your results with the official data provided by the adequate authorities.

Some countries have some holidays based on ephemerids and equinoxes. Those are computed for the previous and next 30 years to prevent big computations and dependencies.

Contributing

Please read our contributing.md document to discover how you can contribute to workalendar. Pull-requests are very welcome.

History

This project was born in 2013, as an answer to the question "how do we calculate this date + 5 working days?". It was a use-case for PeopleDoc, in their ticketing application, for calculating SLAs. And it began as a small open-source library, for France and the USA at first.

Thanks to PeopleDoc, this project grew and eventually became a world-wide library, with the help of dozens of contributors.

As of June 2021, this project has moved to its own organization.

License

This library is published under the terms of the MIT License. Please check the LICENSE file for more details.

workalendar's People

Contributors

ajcobo avatar atj01 avatar atmclarke avatar attilajuhaszhc avatar borfast avatar brunobord avatar brutasse avatar cwittlinger avatar egguy avatar eumiro avatar ewjoachim avatar flix6x avatar fvlima avatar gregn610 avatar hersoncruz avatar iamsk avatar jack-pace avatar janmalte avatar jaraco avatar kidkarolis avatar ludodedo avatar luismalta avatar macharmi avatar micodls avatar mountinash789 avatar qtheuret avatar roxel avatar spalac24 avatar tinogis avatar uvchik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workalendar's Issues

sets are not sorted

well, sets are very convenient to get fast responses to "in" or "not in" and add days without having duplicates, but they're not sorted.

If one day someone wants to chronologically list all the holidays of a year, it will probably not be sorted.

Will probably add a "holidays_sorted()" method to extract holidays and return them as an ordered list (or tuple).

extensive documentation about core

the core.py modules starts to become a bit too big. It'd be great to have a helpful documentation about its internals and how to use the Mixins.

Cannot import workalendar in ipython (DistributionNotFound)

It works when I use the normal python console, but not with ipython. I've tried with and without ipython installed in the virtualenv (it's installed globally).

Steps to recreate:

> virtualenv ve
> . ve/bin/activate
> pip install workalendar
> ipython
In [1]: import workalendar
---------------------------------------------------------------------------
DistributionNotFound                      Traceback (most recent call last)
<ipython-input-1-375fa58b25cd> in <module>()
----> 1 import workalendar

/home/flyte/temp/workalendar/ve/lib/python2.7/site-packages/workalendar/__init__.py in <module>()
      4 
      5 #: Module version, as defined in PEP-0396.
----> 6 __version__ = pkg_resources.get_distribution(__package__).version

/usr/lib/python2.7/dist-packages/pkg_resources.pyc in get_distribution(dist)
    328     """Return a current distribution object for a Requirement or string"""
    329     if isinstance(dist,basestring): dist = Requirement.parse(dist)
--> 330     if isinstance(dist,Requirement): dist = get_provider(dist)
    331     if not isinstance(dist,Distribution):
    332         raise TypeError("Expected string, Requirement, or Distribution", dist)

/usr/lib/python2.7/dist-packages/pkg_resources.pyc in get_provider(moduleOrReq)
    207     """Return an IResourceProvider for the named module or requirement"""
    208     if isinstance(moduleOrReq,Requirement):
--> 209         return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
    210     try:
    211         module = sys.modules[moduleOrReq]

/usr/lib/python2.7/dist-packages/pkg_resources.pyc in require(self, *requirements)
    684         """
    685 
--> 686         needed = self.resolve(parse_requirements(requirements))
    687 
    688         for dist in needed:

/usr/lib/python2.7/dist-packages/pkg_resources.pyc in resolve(self, requirements, env, installer, replacement)
    582                         # unfortunately, zc.buildout uses a str(err)
    583                         # to get the name of the distribution here..
--> 584                         raise DistributionNotFound(req)
    585                 to_activate.append(dist)
    586             if dist not in req:

DistributionNotFound: workalendar

My pip freeze:

argparse==1.2.1
ipython==2.0.0
lunardate==0.1.4
pyCalverter==1.6.1
pyephem==3.7.5.2
python-dateutil==2.2
pytz==2014.2
six==1.6.1
workalendar==0.1
wsgiref==0.1.2

pip version:

pip 1.5.4 from /home/flyte/temp/workalendar/ve/local/lib/python2.7/site-packages (python 2.7)

setuptools version:

setuptools 2.2

Scotland

Scotland calendar doesn't look like a piece of cake, they've got extra days for cities (like Glasgow, or Inverness...)

probably won't be able to do it for the advent calendar, but I'll try to integrate it as quickly as I can.

Pypi package for release 0.4.3 seems not correct

Hi,

I'm try to install workalendar using pip but when I'm run pip install workalendar it shows a next error:

Downloading/unpacking workalendar from https://pypi.python.org/packages/12/86/c1fc76cf70bf66a134f40ac8c1c1398f5966ba9681b451055f2ae0a97e48/workalendar-0.4.3.linux-x86_64.tar.gz#md5=4b1d4cf26d3477b78c42aa052bf897ab
  Downloading workalendar-0.4.3.linux-x86_64.tar.gz (50kB): 50kB downloaded
  Running setup.py egg_info for package workalendar
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
    IOError: [Errno 2] No such file or directory: '/home/gjulia/ve/erp/build/workalendar/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

IOError: [Errno 2] No such file or directory: '/home/gjulia/ve/erp/build/workalendar/setup.py'

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/gjulia/ve/erp/build/workalendar
Storing complete log in /home/gjulia/.pip/pip.log

My pip version is 1.3.1

So I'm download next link using wget

https://pypi.python.org/packages/12/86/c1fc76cf70bf66a134f40ac8c1c1398f5966ba9681b451055f2ae0a97e48/workalendar-0.4.3.linux-x86_64.tar.gz#md5=4b1d4cf26d3477b78c42aa052bf897ab

Then when I decompressed the file it seems that is not ok:

#tar -zxvf workalendar-0.4.3.linux-x86_64.tar.gz 
./
./home/
./home/novapost/
./home/novapost/.virtualenvs/
./home/novapost/.virtualenvs/TOX/
./home/novapost/.virtualenvs/TOX/lib/
./home/novapost/.virtualenvs/TOX/lib/python2.7/
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar-0.4.3-py2.7.egg-info/
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar-0.4.3-py2.7.egg-info/not-zip-safe
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar-0.4.3-py2.7.egg-info/PKG-INFO
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar-0.4.3-py2.7.egg-info/requires.txt
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar-0.4.3-py2.7.egg-info/dependency_links.txt
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar-0.4.3-py2.7.egg-info/SOURCES.txt
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar-0.4.3-py2.7.egg-info/top_level.txt
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/oceania.py
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/america.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/usa.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/europe.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/core.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/usa.py
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/europe.py
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/oceania.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/canada.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/asia.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/canada.py
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/__init__.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/core.py
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/africa.py
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/america.py
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/__init__.py
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/africa.pyc
./home/novapost/.virtualenvs/TOX/lib/python2.7/site-packages/workalendar/asia.py

Thanks

add dummy translation calls for holidays

Adding a dummy translation call would be very nice to integrate this into a django project with translations.

An alternative would be a native translation inside this module. Would be much more work I think.

def ugettext(value):
    return value

class CzechRepublic(WesternCalendar, ChristianMixin):
    "Czech Republic"
    include_easter_monday = True

    FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
        (1, 1, ugettext("Restoration Day of the Independent Czech State")),
        (5, 1, ugettext("Labour Day")),
        (5, 8, ugettext("Liberation Day")),
        (7, 5, ugettext("Saints Cyril and Methodius Day")),
        (7, 6, ugettext("Jan Hus Day")),
        (9, 28, ugettext("St. Wenceslas Day (Czech Statehood Day)")),
        (10, 28, ugettext("Independent Czechoslovak State Day")),
        (11, 17, ugettext("Struggle for Freedom and Democracy Day")),
        (12, 24, ugettext("Christmas Eve")),
        (12, 26, ugettext("St. Stephen's Day (The Second Christmas Day)")),
    )

Refactor Germany test classes

A lot of duplicated lines. Nothing blocking, it's a low-priority task, but that'd be great to have less code in it.

USA regional calendars

USA have federaln holidays, computed in the UnitedStatesCalendar. Some regions have extra days.

Japan: Mountain Day (8/11) from 2016

8/11 becomes public holiday in Japan from 2016.

Public holidays in Japan - Wikipedia
https://en.wikipedia.org/wiki/Public_holidays_in_Japan

>>> from workalendar.asia import Japan
>>> cal = Japan()
>>> cal.holidays(2016)
[(datetime.date(2016, 1, 1), 'New year'),
 (datetime.date(2016, 1, 11), 'Coming of Age Day'),
 (datetime.date(2016, 2, 11), 'Foundation Day'),
 (datetime.date(2016, 3, 20), 'Vernal Equinox Day'),
 (datetime.date(2016, 4, 29), 'Showa Day'),
 (datetime.date(2016, 5, 3), 'Constitution Memorial Day'),
 (datetime.date(2016, 5, 4), 'Greenery Day'),
 (datetime.date(2016, 5, 5), "Children's Day"),
 (datetime.date(2016, 7, 18), 'Marine Day'),
 (datetime.date(2016, 9, 19), 'Respect-for-the-Aged Day'),
 (datetime.date(2016, 9, 22), 'Autumnal Equinox Day'),
 (datetime.date(2016, 10, 10), 'Health and Sports Day'),
 (datetime.date(2016, 11, 3), 'Culture Day'),
 (datetime.date(2016, 11, 23), 'Labour Thanksgiving Day'),
 (datetime.date(2016, 12, 23), "The Emperor's Birthday")]

make pypi to upload to PYPI

  • add a makefile target to correctly upload to PYPI,
  • allow using a different location (to use your own localshop / devpi mirror)

Holidays are rendered as tuples

The Calendar.get_calendar_holidays returns a list of tuples. This model is not very extensible. It constrains the interface such that the returned types must always be the two objects. Instead, workalendar would be better served to return an object with properties.

Add Religion-specific calendars?

Why not having specific religious calendars? (e.g. Jewish or Muslim calendar). One could build a custom calendar with his/her own country-specific holidays and the religious ones.

the "holidays" method being the union of the different calendars.

Make a release now

Development is now a bit slower, but the development code is vastly superior to the only release ever made.

Time for a second release!

International days

It will be cool, if there are also international days added to this repository. What do you think?

Removing "Calendar" from the classes names?

With the number of tests and classes growing up, and me, writing test classes and code, I was wondering if the "Calendar" suffix was necessary.

Compare:

from workalendar.europe import FranceCalendar, IcelandCalendar
from workalendar.america import UnitedStatesCalendar

vs.

from workalendar.europe import France, Iceland
from workalendar.america import UnitedStates

Pros:

  • easier to write, to read,
  • who needs "calendar"? We're always importing calendars out of workalendar lib anyway.
  • some class names are going to be long, if we add up the CountryRegionCloserArea scheme.

Cons:

  • We would have to rewrite the existing classes,

Any idea?

Northern Ireland

Northern Ireland's got 2 extra holidays (refs #20)

  • Battle of the Boyne
  • St Patrick's day

Holidays generated do not reflect their indicated date

When rendering a calendar, it would be useful for the calendar to reflect the indicated date for each holiday. For example, "New year" happens on "the first day in January" or "January 1st". That's pretty simple, but other holidays have a more complicated indication, such as "Martin Luther King, Jr. Day" which is indicated on the "3rd Monday in January". These indications are useful for someone reading the calendar to know what indicated that date.

Lose requirements.pip

I believe a requirements.txt file is appropriate for projects like big business applications, but a simple library such as this should just use distribute's install_requires argument instead.

If I am wrong, please enlighten me :-)

Australia - Christmas day and Boxing day extra days not calculated

As per http://www.australia.gov.au/topics/australian-facts-and-figures/public-holidays for all the states realizes that an extra public holiday is to be added when Christmas Day or Boxing Day falls on a weekend.

I've modified the code oceania.py with the following changes (cleaned from United kingdom configuration)

diff --git a/workalendar/oceania.py b/workalendar/oceania.py
index e138c3a..c945c0a 100644
--- a/workalendar/oceania.py
+++ b/workalendar/oceania.py
@@ -66,6 +66,15 @@ class Australia(WesternCalendar, ChristianMixin):
             days.append(self.get_queens_birthday(year))
         if self.include_labour_day_october:
             days.append(self.get_labour_day_october(year))
+         christmas = date(year, 12, 25)
+         boxing_day = date(year, 12, 26)
+         if christmas.weekday() in self.get_weekend_days():
+             shift = self.find_following_working_day(christmas)
+             days.append((shift, "Christmas Shift"))
+             days.append((shift + timedelta(days=1), "Boxing Day Shift"))
+         elif boxing_day.weekday() in self.get_weekend_days():
+             shift = self.find_following_working_day(boxing_day)
+             days.append((shift, "Boxing Day Shift"))
         return days

python 3.4 / 3.5

Upgrade the tox.ini file to test against Python 3.4 (and 3.5?)

ISO 3166 country code

http://www.ciolek.com/owtrad/iso3166-countrycodes.html

It would be nice to be able to be able to load a Calendar from its country code.
For now the API requires us to do

from workalendar.europe import FranceCalendar

But in an environment where I need to dynamically get the holidays dates based on a country code something like

from workalendar import ISO3166Calendar
calendar =  ISO3166Calendar.from_code("KR") ?

Just an idea.

Nomenclature in code

Generally I like to see that the code has great, self-explaining variable and method names. But just a few could be improved.

http://en.wikipedia.org/wiki/Business_day
English is a second language for me, but it appears workday is not a word. Instead, they say "business day" or "working day". Notice both have 2 words.

The constant WEEK_END_DAYS had better be called, simply, WEEKENDS, which is a single word in English.

The constant FIXED_DAYS should be renamed to FIXED_HOLIDAYS, thus explaining itself better.

I can make a pull request if you agree.

Taiwan

I'm working on integrating Taiwan holidays.

Work done by @grigouze in #22 is great, however I am having troubles using it for Taiwan, and specifically for the Tomb Sweeping day (aka Qingminjie).

This day happens 15 days after the Spring equinox. There is a list available on Wikipedia based on UTC (and sourced from NASA's JPL Horizons On-Line Ephemeris System):

https://en.wikipedia.org/wiki/Qingming

If I use UTC as well, I should have something like this:

ephem.Date(str(ephem.next_equinox(str(year)))).datetime() + timedelta(days=15)

However, using this method, I don't find the same result as in the Wikipedia page...

Examples:

YearWikipedia saysthe code above says
20012001-04-04 17:242001-04-04 13:30
20112011-04-05 03:112011-04-04 23:20
20132013-04-04 15:022013-04-04 11:01
20142014-04-04 20:462014-04-04 16:57

The Taiwanese holidays for 2014 are available here:
http://www.dgpa.gov.tw/ct.asp?xItem=11086&ctNode=1358&mp=10

As you can see, April 4th is a day off, which is correct according to the date in Wikipedia, but it does not match the code I'm trying...

Any ideas on this?

Holiday generation creates duplicate entries

In the US calendar, generation of the holidays will produce multiple New Year dates (one for "New year" and another for "New year shift") if the New Year falls on a weekend and shift_new_year is enabled. This mechanism is brittle and not very useful. For example, rendering the calendar for that year will produce extraneous entries.

It would be better to have something where each Holiday has an "observed" date, which can be customized.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.