Re: [whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

2011-03-09 Thread Markus Ernst

Am 09.03.2011 06:51 schrieb Jukka K. Korpela:

Jonas Sicking wrote:


I'm having a little bit hard of a time figuring out what a good UI
would look like in the general case. I.e. what should the UI look like
for

input type=date id=date name=date
value=2011-04-01 list=datelist exclusive
datalist id=datelist
option value=2011-04-01 label=April 1st
option value=2011-04-08 label=April 8th
option value=2011-04-09 label=April 9th
option value=2012-06-06 label=National Day of Sweden
/datalist

Do you allow flipping between only the months which have any available
dates in them using the next/previous month buttons in the date
picker?


That would be the idea, I guess, but there are two alternatives
regarding months that have no applicable days: either skip them or gray
them out. So in your example, when in April 2011, Next month button
could take you to June 2012, or it might take you to to May 2011 with
all days grayed out


It should definitely be the latter, as Next month taking you to 
somewhere else than the next month is confusing. IIRC I have seen JS 
date pickers behave like that, but I am sorry I don't remember where it was.


Even in a rare use case where several months are totally grayed out, the 
user needs the information that no dates are available there - else 
(s)he will assume a technical error or somewhat.


Re: [whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

2011-03-09 Thread Diogo Resende

On Tue, 8 Mar 2011 16:51:25 -0800, Jonas Sicking wrote:
On Tue, Mar 8, 2011 at 10:46 AM, Markus Ernst derer...@gmx.ch 
wrote:

Am 08.03.2011 19:02 schrieb Anne van Kesteren:


On Tue, 08 Mar 2011 12:26:56 +0100, Jukka K. Korpela
jkorp...@cs.tut.fi wrote:


For example, consider a date picker. Quite often, whether trying 
to

make dates or selling flights, there is a known set of
(non-consecutive) days that are possible, so we would like to 
write, say,


input type=date id=date name=date
value=2011-04-01 list=datelist
datalist id=datelist
option value=2011-04-01 label=April 1st
option value=2011-04-08 label=April 8th
option value=2011-04-09 label=April 9th
/datalist


(...)

/ Jonas


I was thinking.. what about allowing big time spans, like: from April 
1st to June 30th? Giving that the date has - as date element 
separators we could not use 1-MM1-DD1-2-MM2-DD2. Couldn't this 
be useful? Even more common might the usecase where a date must be from 
some date onward (or until some date). How is this addressed?


-
Diogo


Re: [whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

2011-03-09 Thread Markus Ernst

Am 09.03.2011 12:19 schrieb Diogo Resende:

On Tue, 8 Mar 2011 16:51:25 -0800, Jonas Sicking wrote:

On Tue, Mar 8, 2011 at 10:46 AM, Markus Ernst derer...@gmx.ch wrote:

Am 08.03.2011 19:02 schrieb Anne van Kesteren:


On Tue, 08 Mar 2011 12:26:56 +0100, Jukka K. Korpela
jkorp...@cs.tut.fi wrote:


For example, consider a date picker. Quite often, whether trying to
make dates or selling flights, there is a known set of
(non-consecutive) days that are possible, so we would like to
write, say,

input type=date id=date name=date
value=2011-04-01 list=datelist
datalist id=datelist
option value=2011-04-01 label=April 1st
option value=2011-04-08 label=April 8th
option value=2011-04-09 label=April 9th
/datalist


(...)

/ Jonas


I was thinking.. what about allowing big time spans, like: from April
1st to June 30th? Giving that the date has - as date element
separators we could not use 1-MM1-DD1-2-MM2-DD2. Couldn't this
be useful? Even more common might the usecase where a date must be from
some date onward (or until some date). How is this addressed?


I assume that this is only a problem if you need to allow/disallow 
several periods in the same date picker. For one single period, or 
allowing dates only from or up to some date, you can use min and max 
attributes in the input type=date element.


[whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

2011-03-08 Thread Markus Ernst

Am 08.03.2011 19:02 schrieb Anne van Kesteren:

On Tue, 08 Mar 2011 12:26:56 +0100, Jukka K. Korpela
jkorp...@cs.tut.fi wrote:

For example, consider a date picker. Quite often, whether trying to
make dates or selling flights, there is a known set of
(non-consecutive) days that are possible, so we would like to write, say,

input type=date id=date name=date
value=2011-04-01 list=datelist
datalist id=datelist
option value=2011-04-01 label=April 1st
option value=2011-04-08 label=April 8th
option value=2011-04-09 label=April 9th
/datalist

This is currently conforming, though no browser seems to make use of
the datalist. A good implementation would open up a calendar for
April, with only days 1, 8, 9 selectable and day 1 highlighted. Many
existing applications use such interfaces, so there is apparent need
for them.


Agreed that we should fix this, but note that datalist is for
additional or pre-suggested options. The idea is that the user still has
choice so the other days should be selectable too.


Which means in the mentioned use case, that the user can select a date 
when no flight is actually available. We can of course validate the 
input and ask the user to select another date, but still this results in 
sub-optimal user experience (and extra JS code).


The exclusive attribute suggested by Jukka K. Korpela for the datalist 
element would change this behaviour, making unavailable options 
unselectable.


I hope very much that this proposal will make it into the standard. 
Except for date/time and color input elements, I can also imagine use 
cases regarding the range element (if a part of the range is not available).


Re: [whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

2011-03-08 Thread Anne van Kesteren

On Tue, 08 Mar 2011 19:46:41 +0100, Markus Ernst derer...@gmx.ch wrote:
I hope very much that this proposal will make it into the standard.  
Except for date/time and color input elements, I can also imagine use  
cases regarding the range element (if a part of the range is not  
available).


We should probably get the existing functionality implemented a bit better  
first. :-)



--
Anne van Kesteren
http://annevankesteren.nl/


Re: [whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

2011-03-08 Thread Jonas Sicking
On Tue, Mar 8, 2011 at 10:46 AM, Markus Ernst derer...@gmx.ch wrote:
 Am 08.03.2011 19:02 schrieb Anne van Kesteren:

 On Tue, 08 Mar 2011 12:26:56 +0100, Jukka K. Korpela
 jkorp...@cs.tut.fi wrote:

 For example, consider a date picker. Quite often, whether trying to
 make dates or selling flights, there is a known set of
 (non-consecutive) days that are possible, so we would like to write, say,

 input type=date id=date name=date
 value=2011-04-01 list=datelist
 datalist id=datelist
 option value=2011-04-01 label=April 1st
 option value=2011-04-08 label=April 8th
 option value=2011-04-09 label=April 9th
 /datalist

 This is currently conforming, though no browser seems to make use of
 the datalist. A good implementation would open up a calendar for
 April, with only days 1, 8, 9 selectable and day 1 highlighted. Many
 existing applications use such interfaces, so there is apparent need
 for them.

 Agreed that we should fix this, but note that datalist is for
 additional or pre-suggested options. The idea is that the user still has
 choice so the other days should be selectable too.

 Which means in the mentioned use case, that the user can select a date when
 no flight is actually available. We can of course validate the input and ask
 the user to select another date, but still this results in sub-optimal user
 experience (and extra JS code).

 The exclusive attribute suggested by Jukka K. Korpela for the datalist
 element would change this behaviour, making unavailable options
 unselectable.

 I hope very much that this proposal will make it into the standard. Except
 for date/time and color input elements, I can also imagine use cases
 regarding the range element (if a part of the range is not available).

I'm having a little bit hard of a time figuring out what a good UI
would look like in the general case. I.e. what should the UI look like
for

input type=date id=date name=date
value=2011-04-01 list=datelist exclusive
datalist id=datelist
option value=2011-04-01 label=April 1st
option value=2011-04-08 label=April 8th
option value=2011-04-09 label=April 9th
option value=2012-06-06 label=National Day of Sweden
/datalist

Do you allow flipping between only the months which have any available
dates in them using the next/previous month buttons in the date
picker? That seems like it could be somewhat confusing. And how/where
do you show the labels?

Or do you do some type of dropdown without a date picker at all? How
would that be different from just a select?

There's not really any point in adding a feature unless we can also
think of good UI for it. We don't need to specify UI (in fact, we
shouldn't), but we have to make sure that good UI is possible. Authors
need to be able to depend on that the UI will look decent and blend in
with their page, otherwise they won't want to use the feature.

/ Jonas


Re: [whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

2011-03-08 Thread Jukka K. Korpela

Jonas Sicking wrote:


I'm having a little bit hard of a time figuring out what a good UI
would look like in the general case. I.e. what should the UI look like
for

input type=date id=date name=date
value=2011-04-01 list=datelist exclusive
datalist id=datelist
option value=2011-04-01 label=April 1st
option value=2011-04-08 label=April 8th
option value=2011-04-09 label=April 9th
option value=2012-06-06 label=National Day of Sweden
/datalist

Do you allow flipping between only the months which have any available
dates in them using the next/previous month buttons in the date
picker?


That would be the idea, I guess, but there are two alternatives regarding 
months that have no applicable days: either skip them or gray them out. So 
in your example, when in April 2011, Next month button could take you to 
June 2012, or it might take you to to May 2011 with all days grayed out



That seems like it could be somewhat confusing.


Mildly, I would say, and the example is somewhat anomalous. In typical use 
cases, dates are relatively close to each other.



And how/where do you show the labels?


They could be shown on mouseover. Alternatively, a datalist exclusive 
could be implemented as a dropdown or listbox, showing the labels (or, in 
their absence, the value attributes) as selectable items.



Or do you do some type of dropdown without a date picker at all?


That would be an acceptable implementation.


How would that be different from just a select?


Select is generic, like input type=text, as opposite to input 
type=date, input type=color etc. So an implementation cannot 
implement select in a content-aware way, like a date or color picker, but 
it can (and hopefully will, but it is not required to) implement e.g. input 
type=date with associated datalist as a date picker with some dates 
highlighted and possibly (when the proposed new exclusive attribute is 
used) all other dates grayed out.


--
Yucca, http://www.cs.tut.fi/~jkorpela/