Opened 15 years ago
Closed 10 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: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Date/Time | Keywords: | has-patch |
| Focuses: | Cc: |
Description
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)
Change History (9)
@
12 years ago
Made a option to select the type of date/time display and changed it accordingly in comment-template
#3
@
12 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.
This ticket was mentioned in IRC in #wordpress-dev by gauravmittal_. View the logs.
12 years ago
#7
@
12 years ago
- Keywords close added
- 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. - We probably don't need a new UI option, it would go against the "Decisions, not options" philosophy.
- 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.
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?