Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kenyan calendar #484

Merged
merged 1 commit into from Apr 17, 2020
Merged

Add Kenyan calendar #484

merged 1 commit into from Apr 17, 2020

Conversation

KidkArolis
Copy link
Contributor

@KidkArolis KidkArolis commented Apr 15, 2020

  • Tests with a significant number of years to be tested for your calendar.
  • Docstrings for the Calendar class and specific methods.
  • Use the workalendar.registry_tools.iso_register decorator to register your new calendar using ISO codes (optional).
  • Calendar country / label added to the README.rst file.
  • Changelog amended with a mention like: "Added <country> by @pseudo (#)".

(12, 31, "New Years Eve"),
)

def get_fixed_holidays(self, year):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to dynamically introduce 'Moi Memorial Day' in 2020 and to rename some things based on year.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the right way to go!


return days

def get_shifted_holidays(self, dates):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added these next two methods to shift Sundays to Mondays, but I've excluded the Islamic days from being shifted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent!

@KidkArolis
Copy link
Contributor Author

Fixed the linting.

Copy link
Member

@brunobord brunobord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll just need to make small changes, and I'll be glad to see Kenya added to the library!

Changelog.md Outdated Show resolved Hide resolved
workalendar/africa/kenya.py Outdated Show resolved Hide resolved
(12, 31, "New Years Eve"),
)

def get_fixed_holidays(self, year):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the right way to go!


return days

def get_shifted_holidays(self, dates):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent!

@KidkArolis
Copy link
Contributor Author

Amended

@brunobord brunobord merged commit 5f20d06 into workalendar:master Apr 17, 2020
brunobord added a commit that referenced this pull request Apr 17, 2020
**New Calendar**

- Added Kenyan calendar, by @KidkArolis (#484)

**Minor fixes**

- Fixed Lithuania calendar to use the core flags for Assumption and All Saints (#468).
- Fixed Malta calendar ; January 1st was already included, no need to add it to the ``FIXED_HOLIDAYS`` property (#469).
- Small refactor in Netherlands calendar to use core constants (#470).
@brunobord brunobord mentioned this pull request Apr 17, 2020
14 tasks
@brunobord
Copy link
Member

The latest workalendar release (8.4.0) now integrates your Kenyan calendar. Happy upgrading! https://pypi.org/project/workalendar/8.4.0/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants