Make WordPress Core

Opened 13 years ago

Closed 9 years ago

#17525 closed feature request (wontfix)

There should be a datetime_format option to specify whether the date or the time comes first

Reported by: holizz's profile holizz Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Date/Time Keywords: has-patch
Focuses: Cc:


As a theme author it would be very useful to have a global option for formatting a full datetime (and a the_datetime() function too).

Sometimes datetimes are formatted "$date $time", sometimes it's "$time $date", sometimes it's even "$date at $time".

I think there should be an option for this in the general settings alongside the date and time format options.

Attachments (1)

17525.patch (5.1 KB) - added by gauravmittal1995 10 years ago.
Made a option to select the type of date/time display and changed it accordingly in comment-template

Download all attachments as: .zip

Change History (9)

#1 @nacin
10 years ago

  • Component changed from General to Date/Time

#2 @gauravmittal1995
10 years ago

Hello ... I am trying to implement this. Can you tell me where all in a theme are the date and time used together? Right now, I have found it in the comments. Where else are they used?

10 years ago

Made a option to select the type of date/time display and changed it accordingly in comment-template

#3 @gauravmittal1995
10 years ago

I still need places where date and time appear together. This patch creates an option to select which format you want and displays the comments in that format (since I found date-time appear together in comment-template till now) .... Please give me location for the other places and I will finish off this feature.

#4 @gauravmittal1995
10 years ago

  • Keywords has-patch added

This ticket was mentioned in IRC in #wordpress-dev by gauravmittal_. View the logs.

10 years ago

#6 @gauravmittal1995
10 years ago

  • Keywords dev-feedback added

#7 @SergeyBiryukov
10 years ago

  • Keywords close added
  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 "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.

#8 @chriscct7
9 years ago

  • Keywords dev-feedback close removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

No further interest in 1.5 years. If interest re-emerges, feel free to reopen.

Note: See TracTickets for help on using tickets.