Page MenuHomePhabricator

Make the "year" field default to the current year on histories
Closed, ResolvedPublic

Description

I don't see much use in providing an empty "year" field, because if the user clicks on any of the arrows it will go to something as useful as year "-1" or "1".
E.g.: http://www.mediawiki.org/wiki/MediaWiki?action=history


Version: 1.21.x
Severity: minor
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=45580

Details

Reference
bz41330

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:11 AM
bzimport set Reference to bz41330.

Created attachment 11523
screenshot of the field

Attached:

Captura_de_tela_de_2012-12-16_18:58:06.png (338×895 px, 55 KB)

Wow, I have section-blindness. :)

Those arrows were added by your browser due to usage of type="number".
When presented as type="text", it makes more sense. I'm not sure if type="number" should be used as a year or not.

http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#number-state-%28type=number%29 says
"A simple way of determining whether to use type=number is to consider whether it would make sense for the input control to have a spinbox interface"
and for it makes sense. But going up to 1 from "empty" for a year representation does not. May even be a browser bug.

So it makes sense to use the current year as you claimed.

What does your browser when presented with: <input type="number" min="2001" max="2012" value="" /> ?

(In reply to comment #3)

What does your browser when presented with: <input type="number" min="2001"
max="2012" value="" /> ?

In your example, when I load the page the field is empty. After I use any of the buttons it shows the number 2001.

For the record, I was using Google Chrome 22.0.1229.94. On Firefox 17.0.1 there is no button to increase/decrease the value.