Closed
Description
There isn't a standard of default time format in EO. While all date/time formatting on the front-end is changeable - there should perhaps be a 'unified' default value. For example
- Page templates use 'j F Y g:ia'
- Event admin page & event list Shortcodes/widgets use the WordPress settings
- fullCalendar uses the 24 hour time by default. Can be edited with 'timeformat' attribute
- admin Calendar can be switched between 24/12 hour via screen options on that page
(See this thread).
For admin-side, determining whether 24 or 12 hour time should be used should be taken from the time setting option.
Possible problems:
- Time setting is for display, so it may be 12 hour, while admins may prefer entering in 24 hour.
- Some languages don't have 'am' or 'pm' - they use 24 hour.
Would require a function which takes a string (time format) and outputs whether its using 12 or 24 hour time.
An option could be added to the settings page to change this 'guess' manually - but do we really want another option...?
Pull requests, welcome!
Todo
- Create function to check if blog is using 24/12 hour time:
eventorganiser_blog_is_24()
- Default templates should use
get_option('time_format')
- Default time format for agenda should be based on
eventorganiser_blog_is_24()
- Default calendar time format should be based on
get_option('time_format')
- Admin calendar 12/24 hour screen option should be based on
eventorganiser_blog_is_24()
(and possibly removed) - Default formats of event list shortcode/widgets should be
get_option('time_format')
- Maybe: Allow input of time formats in 12/24 format.