Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291721

"Date and time" widget for date field allows to type 6 digit year component

$
0
0

Problem/Motivation

The core date field widget allows 6 digits for the year. It should be limited to 4 digits. There is an error on submit but as kepesv notes, this is very annoying for users who have the year field first, as the user would expect to be entering the month but is instead still entering the year value.

Steps to reproduce:

  1. Install Drupal
  2. Add a date field to the article node type
  3. Enter a date with a six digit year
  4. Error message on submit flags it as invalid

(I'm not sure how to set my browser to put the year field first but kepesv has posted a screenshot of this so it must be possible.)

Proposed resolution

Limit the year value to four digits in the date widget. This should be relatively simple as the field does not accept more than 4 digits, so there is no risk of affecting existing data.

Remaining tasks

User interface changes

Original issue
-----

"Date and time" widget for date field has an annoying behavior. It allows to type 6 digit year component. This causes the problem.
In computers with DD.MM.YYYY date component order it doesn't cause any particular problem because after user typed 2 digits for days, cursor shifts to months. After typed months cursor automatically shift to year.
But YYYY.MM.DD. component order: User type 4 digits of year. User expects that after the 4th digit of year cursor will shift to month. But it doesn't do it because Year component can be 6 digits. This is the problem. I think limiting the year component to 4 digits could be solve the problem.


Viewing all articles
Browse latest Browse all 291721

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>