Use first day of next month as upper bound for donations #8
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
RollenspielMonster/website!8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/8/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This fixes an issue where donations for the last day of the month were
not displayed. This was due to the upper bound being the last day of the
month, but at 00:00.
The right way to do it is to check if the date is less than the first
day of next month at 00:00. This is a bit tricky. Go/Hugo offers an
AddDatefunction, which I almost used. However, because today is the31st of May and June doesn't have 31 days, adding a month flipped over
to July, which would mess up our table.
I therefore resorted to a more basic implementation, which is commented
in the template itself. I almost forgot the modulo operation which would
have caused issues in December.
I'm not totally happy with this solution, because it comes with a lot of
moving parts and it's possible that I messed up or forgot another edge
case, but it's the best I can come up with right now.
Thanks for the suggestion, here I could shorten the whole thing to one line 😅
279ae5a437Pull request closed