15. feb 2001
dez 19ter-15. '01
januar - dezember '04
etc. it's german date formats ;).
It is of course not easily to be seen by users that they can use pretty complex pattern - but since it was a web application that was no problem with some hints next to the input field.
My conclusion would be, that I could see, how this type of date (-range) input could work out well for a blog archive or article search instead of displaying calendars or using 3 text input field as in your simple example.
(what does email notification in your comments form mean at all? *checking*) :p
I'm just being an ass, but I like to spell out the number of the month. How come your system does support that?
Not really, but I do second a trim() function. I have a soft space bar which gets pressed at all the wrong times.
A month array has just 12 options, why not just show all of them in a select list?
gani: I actually debated as to whether I should just default to displaying the month if only one possible month was an option. I decided against it because I felt that if only one character was entered, it might have been by accident. Just a hunch, though.
Jurgen: 12 options is still a lot when you use just a keyboard to navigate. The next time you find a dop down on a site, try using the keyboard to select an option.
Interesting idea... I've seen similar. I can think of no case where adding 4.12 KB to a page would be worth this functionality, save on an Intranet application. I mean, that's a lot of page weight when you could *easily* do the same thing in server side code, and knock a few seconds off your form's load time.
function numSort(a,b) {
a = parseInt(a);
b = parseInt(b);
if(a > b) return 1;
if(b > a) return -1;
return 0;
}
Is simplified to:
function numSort(a,b)
{
a = parseInt(a);
b = parseInt(b);
return (a > b) - (b > a);
}
Wayne: That's fantastic! Thanks for the tip.
beautiful script
Why not simply :
function numSort( a, b )
{
return parseInt( a )-parseInt( b )
}
o__
dropdown with suggestions is key. nice.
This is nice, but one question: Why doesn't it return f=february, s=september etc. for months that have singular starting letters? That makes more sense than an error message in those cases.