ADR0001: Consistent Date/Time Formats #85
kimadactyl
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context and Problem Statement
We want to use consistent date/time formats and methods of rendering them across the whole of imok, but there are a number of options for how we do that. There are pros and cons to all of them.
Considered Options
strftime('%x')
andstrftime('%X')
(long form dates and times in member's locale)strftime('%Y-%m-%d')
andstrftime('%H:%M')
(ISO-8601 24hour times)time_format(time_obj, format='SHORT_TIME_FORMAT', use_l10n=True)
anddate_format(date_obj, format='SHORT_DATE_FORMAT', use_l10n=True)
(short form dates and times in member's locale)As we are discussing both time and date formats, there is of course the option to mix and match.
Decision Outcome
Chosen option: Do nothing. The current mixture of formats we have are working, and this decision is not one we want to make without consultation. We will raise a GitHub issue to discuss this in more depth.
Pros and Cons of the Options
Long form dates and times in member's locale
This is the method we have been mostly using up until now. It displays a long form of the date and time in a way that the member's locale describes (en_GB for admins)
Examples:
ISO-8601 24hour times
Display dates in ISO-8601 and times using the 24 hour clock.
Examples:
Short form dates and times in member's locale
Use
time_format
anddate_format
with theSHORT
formats.Examples:
Babel and short form dates and times in member's locale
Add an additional Python module
Babel
to display the times in the member's locale but with greater language support than Django's own formats.Examples:
Beta Was this translation helpful? Give feedback.
All reactions