[wp-trac] [WordPress Trac] #39285: Date formatting shortcuts

WordPress Trac noreply at wordpress.org
Wed Dec 14 19:27:33 UTC 2016


#39285: Date formatting shortcuts
-----------------------------+-----------------------------
 Reporter:  iseulde          |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Date/Time        |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Follow-up on #30864. Related to #39222.

 The idea is to have a series of translated (and maybe filterable)
 shortcuts for date strings that are commonly used, which would hopefully
 encourage more consistent date formats in admin interfaces.

 It's similar to what [http://momentjs.com/docs/#localized-formats
 Moment.js] does, but I think it wouldn't hurt to be a bit more verbose
 (for clarity).

 I'm thinking of something like `get_date_format( 'time' )`, where there
 could be a few core defined strings like:

 * `time`: 7:30 p.m.
 * `short-date`: 12/14/2016
 * `long-date`: 14 December 2016
 * `full-date`: Wednesday, 14 December, 2016

 Etc.

 I think this would also make it a bit easier for translators. :)

 Summary from #30864:

 Replying to [comment:12:ticket:30864 iseulde]:
 > [...] I don't think it would be a bad idea to have a shortcut to use
 these in core, to make it easier for plugins to pick a date format that is
 properly localised.

 Replying to [comment:15:ticket:30864 markjaquith]:
 > [...] We should have, in core, filterable, localized "short" and "long"
 date/time and date-time format strings that we use in core and that
 developers can use.

 Replying to [comment:28:ticket:30864 azaozz]:
 > [...] Thinking we need something like `localized_date_time` array with
 short and long date formats, and short and long (with seconds) time
 formats? That should be settable by translating the default settings.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39285>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list