Skip to content

Add one second padding to format_infraction_with_duration#819

Closed
Akarys42 wants to merge 2 commits into
masterfrom
format-infraction-with-duration-one-sec
Closed

Add one second padding to format_infraction_with_duration#819
Akarys42 wants to merge 2 commits into
masterfrom
format-infraction-with-duration-one-sec

Conversation

@Akarys42
Copy link
Copy Markdown
Contributor

@Akarys42 Akarys42 commented Mar 5, 2020

It caused the message to be rounded one second down, for example 59 minutes and 59 seconds instead of 1 hour, because of the way humanize_delta works. This PR simply add a one second padding in order to make the infraction message proper.

It caused the message to be rounded one second down, for example 59m and 59s instead of 1h
@Akarys42 Akarys42 requested a review from a team as a code owner March 5, 2020 09:25
@Akarys42 Akarys42 requested review from SebastiaanZ and scragly and removed request for a team March 5, 2020 09:25
@Akarys42 Akarys42 added the a: moderation Related to community moderation functionality: (moderation, defcon, verification) label Mar 5, 2020
@ikuyarihS
Copy link
Copy Markdown
Contributor

This won't work if it is not just a second, sometimes it can be up to 5 seconds later, and so adding a simple second will not fix the issue.

It is better to check the actual time and try to round it to round it up if the seconds is close enough to 60.

@Akarys42
Copy link
Copy Markdown
Contributor Author

Akarys42 commented Mar 5, 2020

Closing this PR as the fix will take more work than that.

@Akarys42 Akarys42 closed this Mar 5, 2020
@Akarys42 Akarys42 deleted the format-infraction-with-duration-one-sec branch March 5, 2020 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: moderation Related to community moderation functionality: (moderation, defcon, verification)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants