Closed nikgraf closed 8 years ago
Have someone a sketch or psd or jpeg for the ui?
Most powerful react date picker: https://github.com/gpbl/react-day-picker
I've checked around 5 different date pickers. This one is powerful, because it gives ability to a user modify dates depending on requirements, plus it has most powerful support of i18n (possible to push own localization keys into a component, instead of moment.js).
Yep @dmitry , this one is real good. Thanks.
Today @jpuri & I did some brainstorming. We thought about providing two components:
<DatePicker>
The datepicker component is just the component to select a date. In mobile situations people might want to use it directly. It's also great to just show a calendar in case no event listeners are bound. This also allows people to cover more complex date/range selections with custom components.
<DateInput>
The dateinput looks like an input field. By default we put a calendar icon next it. But clicking the calendar icon a datepicker will open. The text is still editable, but is going to be validated like in this example: http://rudeg.github.io/react-input-calendar/
Collecting couple of design / api thoughts about the component:
Rating component will support these 3 states:
ARIA-properties supported:
Reference for localization data: https://github.com/jquery/jquery-ui/tree/master/ui/i18n
When using date-picker with input box - date input, focus styles of date picker should be totally disabled and CTRL + keys can then be used for kayboard navigation. This might mean much complexity for keyboard handling :(
For days in datePicker it will be better to have a new state (in addition to focus state), so that both mouse and keyboard events can be handled seemlessly. This state may not have any styling associated with it.
Reference: https://jqueryui.com/datepicker/
Highlighting weekend in calendar will be an optional feature. Though many calendar's do no include weekend information as locale data. I think locale data is good place to do that. There will be a property 'styleWeekend' which when true will result in highlighting weekend.
please don't forget to add a date range picker :heart:
I tried a lot of date pickers. From a library consumer perspective, I ended up using this one: http://zippyui.com/react-date-picker/
The api is very simple and I created a date range picker on top of it pretty easily.
@luisrudge I've also tried a lot of date pickers, and found https://github.com/gpbl/react-day-picker very simple to read, to modify and implement a features. On the first sight looks like not possible to implement some features like range of dates, blocking dates etc., but after looking into the modifiers feature you can find out that the power of this date picker is huge. Also almost all the date pickers force you to use moment.js, but only this one gives you option to implement your own i18n interface.
@dmitry awesome! Thanks! This is date picker is really great. It has range as well!
@jpuri interesting read regarding focus behaviour: http://ux.stackexchange.com/questions/52849/datepicker-behavior
@jpuri I thought about the ctrl+up as well, but the issue here is that even on OSX these keyboard short cuts are used for different things by default.
look what I found: http://www.w3.org/TR/wai-aria-practices/#datepicker - I suggest to exactly use the keyboard short cuts as they propose.
This also has some nice hints regarding behaviour: https://www.w3.org/WAI/PF/HTML/wiki/Datepickers
KeyStrokes to be implemented:
Implemented ones:
WAI-ARIA support:
@jpuri I updated the sub-tasks on top (added suggestions & bugs I found)
Nice @nikgraf , I plan to work on all the bugs you highlighted, lets also catchup some time to discuss the suggestions.
My feedback: Great component :) But I am doubtful about merged hover and focus states. This can create unexpected behaviors like someone can hover over a date and press enter to select it - something which will never work for simple button.
Open question:
Todos:
Suggestions
The reason for keep the focus state independent from DOM focus was WAI-ARIA specification that current date should be focused as date picker of focused. And focus behavior while tabbling which was not achievable with DOM focus.
<ActionArea>
rather than touchStart or mouseDown ?Bugs