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

Add date_relative and date_relative_short formatters #1771

Merged
merged 3 commits into from
Jul 27, 2024

Conversation

rafalp
Copy link
Owner

@rafalp rafalp commented Jul 27, 2024

This PR adds relative date formatters to Django and updates templates to use them. Those formatters are using same logic that JS formatters I've did a while a go do. This way when person opens a page that has dates formatted on server, there's no "flash of unstyled content" when those dates are swapped out by JS's dynamic dates.

Also unifies naming between backend and frontend, and adds fallback titles for those without JS.

Fixes #1769

@rafalp rafalp added area: frontend This issue involves JavaScript, React.js and Node area: backend This issue involves Python, Django or dependency (eg. database) labels Jul 27, 2024
@rafalp rafalp added this to the Next feature release milestone Jul 27, 2024
@rafalp rafalp self-assigned this Jul 27, 2024
@rafalp
Copy link
Owner Author

rafalp commented Jul 27, 2024

This change needs tests before I'll merge it.

@coveralls
Copy link

coveralls commented Jul 27, 2024

Coverage Status

coverage: 97.432% (-0.01%) from 97.442%
when pulling 28833f2 on fix-1769-misago-date-formatters
into 5c566d3 on main.

@rafalp rafalp merged commit f4aaea5 into main Jul 27, 2024
1 check passed
@rafalp rafalp deleted the fix-1769-misago-date-formatters branch July 27, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend This issue involves Python, Django or dependency (eg. database) area: frontend This issue involves JavaScript, React.js and Node
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Django date formatters
2 participants