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

Merged
merged 4 commits into from
Jun 22, 2024
Merged

Update date.py #1807

merged 4 commits into from
Jun 22, 2024

Conversation

mailhot001
Copy link
Contributor

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
Contributor 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
Contributor 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.

@yagebu yagebu merged commit 134d40a into beancount:main Jun 22, 2024
16 checks passed
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.

2 participants