[wp-trac] [WordPress Trac] #17525: There should be a datetime_format option to specify whether the date or the time comes first

WordPress Trac noreply at wordpress.org
Wed Jun 4 16:35:46 UTC 2014


#17525: There should be a datetime_format option to specify whether the date or the
time comes first
------------------------------------------+------------------------------
 Reporter:  holizz                        |       Owner:
     Type:  feature request               |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Date/Time                     |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  has-patch dev-feedback close  |     Focuses:
------------------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch dev-feedback => has-patch dev-feedback close


Comment:

 1. Instead of duplicating the logic in `comment-template.php`, a new
 filterable function should be introduced that would return `__( '%1$s at
 %2$s' )` by default.
 2. We probably don't need a new UI option, it would go against the
 [https://wordpress.org/about/philosophy/ "Decisions, not options"
 philosophy].
 3. If we do add a new option, it should store the chosen format itself,
 not a numeric index.

 Personally, I don't think we even need a new function.

 With `the_date()`, `get_the_date()`, `the_modified_date()`,
 `get_the_modified_date()`, `the_time()`, `get_the_time()`,
 `get_post_time()`, `the_modified_time()`, `get_the_modified_time()`,
 `get_post_modified_time()`, `mysql2date()`, `date_i18n()`, it seems like
 theme developers should already have full control over displayed dates.

 If there are no filters in some particular places like `Walker_Comment`,
 we should add them instead of adding new functions or options.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/17525#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list