Remove sample date from date field error message and title attribute

Created on 29 August 2016, almost 8 years ago
Updated 16 January 2024, 5 months ago

Problem/Motivation

Backend date format is different to front end date format (which depends on user's locale) it is not possible to display sample date in the correct format on error messages or in field description on generic form elements.

In Drupal 7 there's no sample date in error messages/description either.

Proposed resolution

  • Remove sample date from error message.
  • Remove title attribute
  • Deprecate DateTime::formatExample

User interface changes

Before:

After:

(NOTE title attribute has been removed).

Original summary

The Authoring information tab let's people edit the author, date and time a node was originally created.

The date field has placeholder input expecting DD-MM-YYYY

But!

The tooltip says "Date (e.g. 2017-02-11)"
The description says Format: "2017-02-11 01:31:30"

This is inconsistent and confusing. We can't change the datetime format for authored on field because the values going into and coming out of are RFC 3339 / ISO 8601 ( See: https://www.w3.org/TR/html-markup/input.date.html )

Current browsers also seem to be implementing HTML5 date fields in their own special ways. According to Ian Devlin on HTML5Doctor

"The implementation of this datepicker is up to the browser vendor, as the HTML5 specification does not tell vendors how to implement the inputโ€™s UI."

"As a user, I expect the help text to guide me to provide the correct date format, so that I can get it right the first time, without guessing."

Can we find a way to make this consistent? We already seem to be automatically inserting today's date here.

๐Ÿ› Bug report
Status

Fixed

Version

11.0 ๐Ÿ”ฅ

Component
Datetimeย  โ†’

Last updated about 6 hours ago

Created by

๐Ÿ‡ฑ๐Ÿ‡ปLatvia matulis

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

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.

Production build 0.69.0 2024