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

Update date.py #1807

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Update date.py #1807

wants to merge 4 commits into from

Conversation

mailhot001
Copy link

remove the + 1 on the week RE match in date parser so that the week number match the front end displayed week number.

related to: #1805

remove the + 1 on the week RE match in date parser so that the week number match the front end displayed week number.
Copy link
Author

@mailhot001 mailhot001 left a comment

Choose a reason for hiding this comment

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

@yagebu Here is my second try, I believe it matches the D3.js week parsing, I've tested it roughly (without edge case) and it is working the same as frontend.

Copy link
Member

@yagebu yagebu left a comment

Choose a reason for hiding this comment

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

Thanks :) Can you add some test cases that show that this is now working correctly in cases where it didn't before?

@mailhot001
Copy link
Author

I added a test case to show an error if ISO week format is used.
Also added a note in the help to explain the week numbering used, a month is a month, but week can be taken differently. The note should help users know how it work without checking the code and then checking the %W definition of strptime.
Or the equivalent definition used in D3.js.

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