-
Notifications
You must be signed in to change notification settings - Fork 687
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 <time datetime= into valid HTML by using a custom jinja tag #6058
Conversation
Thank you, @anorthall! Just a heads-up that this will likely require a rebase after #6041, which moves around the |
No problem. |
Hey, @anorthall, the fix using a) use flask_babel to do the date formatting In either case, thanks for the PR! |
Thanks for the tip/info - I will work on this but not until later tomorrow/Thursday at the latest. |
No problem, and no rush! |
Hopefully that latest PR will be a better solution. As you can see I added the template tag ( All tested and working, and the HTML validates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test plan
- Open the website and validate the HTML.
In addition:
- Specifically, there are no more
Bad value
errors on thetime[datetime]
attributes. - All instances of the pattern
%Y-%m-%d %H:%M:%S%Z
have been replaced by thehtml_format_datetime
filter.
Looks good to me, @anorthall! I've left a comment about the localization question, which I've clarified with @zenmonkeykstop; fortunately the solution is just a deletion here and another issue I'll open separately. :-)
Given that there are a couple of iterations recorded in your branch, it would be ideal if you could squash your commits before merge. Or, if you prefer, @zenmonkeykstop can take care of that as the maintainer who will ultimately approve and merge.
@cfm Changes made and squashed I note the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @anorthall! I confirm that updater-gui-tests
is failing without #6069, but since it's irrelevant to your changes here I agree it's not worth rebasing for it.
Tagging @zenmonkeykstop for final approval and merge.
Apologies @anorthall, a rebase gone awry reverted the changes in the PR - I'll fix it momentarily! |
Hey @anorthall - I've recovered your changes and resubmitted them in PR #6075 rebased against the |
Status
Ready for review
Description of Changes
Fixes #6057
Change the direct call to
__str__()
into a call tostrftime()
to meet the requirement of not having more than 3 decimal places for seconds on HTML. Now, no decimal places are displayed. I decided to implement this instead of the truncate filter as you cannot truncate the datetime object without first converting it to a string.Testing
Open the website and validate the HTML.
Deployment
No special measures required.
Checklist