Make date format choices less ambiguous

Created on 7 July 2008, over 16 years ago
Updated 24 January 2024, 11 months ago

I was setting up a site today and wanted to change the default date format, so went to the page at: admin/settings/date-time

However since today is the 7th of July, I was presented with a choice between '07/07/2008' and '07/07/2008' (see attached pic). I assume this happens on one day a month. The same issue exists in Drupal 5.7.

Although this is potentially a user-facing dialogue, and therefore it should be kept as friendly as possible, it is destined in most cases (I guess) to be setup by the site administrator once and then left alone. For occasions like today, where the day and month are indistinguishable in numeric form, perhaps we could add plain text to clarify.

<!--break-->

The form is generated by the 'system_date_time_settings()' function in system.module. A simple fix might be something like this (beginning at line 797 in D5.7) which appends the date format to the option text string:

  // Date settings: construct choices for user
  foreach ($dateshort as $f) {
    $dateshortchoices[$f] = format_date(time(), 'custom', $f).' ('.$f.')';
  }

It might be more user friendly to add a plaintext alternative to the PHP date strings - e.g: '07/07/2008 (mm/dd/yyyy hh:mm)' instead of '07/07/2008 (d/m/Y - H:i)', but i can't think of an easy way to do that without modifying the existing array.

(Workarounds include: checking an existing site setup, and seeing that it's the 2nd option I want, or waiting 'till tomorrow!)

Feature request
Status

Closed: outdated

Version

11.0 🔥

Component
UI text 

Last updated 4 days ago

No maintainer
Created by

🇫🇷France matkeane

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    Tested this on Drupal 11.x today, standard install. The user now defines the format instead of selecting from a list.

    Cheers

Production build 0.71.5 2024