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

Make day of week convention more consistent across the codebase #731

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

sdispater
Copy link
Owner

Since the beginning, Pendulum had the convention that a week starts on Monday since it's the most common case and matches the ISO standard. However there were a few places where this convention was to enforced:

  • the day_of_week property
  • The d and do tokens when formatting a datetime instance.

This PR makes sure everything is consistent across the codebase. Unfortunately, this makes this change a breaking one since this changes the behavior of the elements mentioned above.

The new e and eo tokens have been introduced to get the day of week but localized base on the week_data of the locale files.

Fixes #683

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 13, 2023

CodSpeed Performance Report

Merging #731 will not alter performance

Comparing refactor/day-of-week-consistency (2aff736) with master (7e4f806)

Summary

✅ 2 untouched benchmarks

@sdispater sdispater force-pushed the refactor/day-of-week-consistency branch from c790854 to 2aff736 Compare August 13, 2023 17:47
@sdispater sdispater merged commit 29c15a6 into master Aug 14, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

start_of('week') and day_of_week inconsistent
1 participant