Page MenuHomePhabricator

Year input fields on special pages should be 4 digits wide
Open, Needs TriagePublic

Description

This is just a really trivial thing that's been bugging me for years because of how clumsy they currently look (even though they correctly have a maxlength attribute of 4).

Event Timeline

Scott created this task.Jul 9 2016, 11:19 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 9 2016, 11:19 PM

Special:Contribution isn't the only place where wide year fields occur. This should be changed for all other places as well: action=history, Special:Log, and possibly others I just missed.

Special:Contribution isn't the only place where wide year fields occur. This should be changed for all other places as well: action=history, Special:Log, and possibly others I just missed.

That should not be a problem, because it is build in Xml::dateMenu and that is used at all three mention places.

Scott renamed this task from Year field on Special:Contributions should be 4 digits wide to Year input fields on special pages should be 4 digits wide.Sep 30 2016, 12:04 AM
Scott updated the task description. (Show Details)
Volker_E added a subscriber: Volker_E.EditedOct 14 2016, 8:09 PM

One could add CSS selector

[type=number][maxlength="4"] {
  max-width: 4em;
}

There's an interesting side-effect of using HTML5 type=number and maxlength as it doesn't restrict to input more than 4 chars. A max attribute with value like 9999 must be added.

See https://codepen.io/Volker_E/pen/QKBBzR

Scott added a comment.Oct 14 2016, 9:00 PM

A good point. The maximum should always be the current year.

A good point. The maximum should always be the current year.

Well, neither https://en.wikipedia.org/wiki/Special:ProtectedPages nor https://en.wikipedia.org/wiki/Special:BlockList allows searching for entries by end date, but they could allow this in the future, and there could be other pages where a year input for future dates might make sense.

Scott added a comment.Oct 18 2016, 8:32 AM

There could be, but I don't know of any, and we should build to existing use cases, not hypothetical future ones.