-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datepicker dropdown editable anchor-button? #109
Comments
Wow; Perfect timing! This has just come up as an issue for me as well. My clients are frustrated that they have to click the month arrows hundreds of times when they need to select a date that's a few years away from the current date. Being able to edit the text representation would resolve this issue for us. So major thumbs up from me. Assuming there's a nontrivial timeline on getting this into re-com, would you be willing to share the source for your implementation @czlang? I'd be putting it into Datview/Datsys and would naturally add you to the contributors list. An alternative solution for us would be to have a second set of arrows that lets you navigate by year. But I agree that it's intuitive to want to edit the textual representation directly, and would overall prefer that. |
yes, that's exactly use case, birthday etc. Year select also came to my mind, but I also think that straight edit is just better (I certainly don't want to scroll year 80 years ago in select or destroy my finger by clicking that arrow 80 times ;-)). So here is gist with what I have right now. I added anchor-input component and input-date component. I'm also playing with some basic format errors alert in input-date. And there is param :input-label (don't like that name) which switches editable input or not. Maybe that's something to consider or start with ;-) |
There's a few use cases we should consider here:
Selecting dates nearby benefit from the spatial awareness a calendar gives.
http://ux.stackexchange.com/questions/49741/when-and-why-should-date-pickers-be-used When selecting dates more than a few months away, a calendar interface ceases to be helpful (as your users have mentioned). In this case, typing the date may be easier. When selecting dates many years away, the calendar ceases to be a benefit at all. I have seen calendar widgets which when you click on the year step backwards to show the months, then the years: I'm not giving any conclusions, but I think we need to be clear on what use cases we're trying to address with date selections, as it may be more appropriate to give a more straightforward date selector without the calendar at all in some cases. |
@danielcompton Very reasoned response. For my case in particular, most of the time, the date picker will still be helpful (last five months or so), but every now it'll need to select outside that normal range by a significant number of years. So having both control modes be part of the same widget would be useful. But perhaps I'm in the minority; I don't know. I'd more or less be okay with having to choose between a more straightforward selector and a calendar selector. But assuming there is such a choice, is there harm in providing an option to have both rolled into one (as opt-in) for situations where it's warranted? |
As mentioned by @danielcompton, the calendar component is generally designed to make it convenient (and visual) to select dates around the current date. If you had a genealogy app or one where birth dates are routinely entered, then this is probably not the component to use. For that, I would be thinking along the lines of three dropdowns for date, month and year, perhaps each having associated text box. Our philosophy is that if possible, never leave the component in an invalid state. We worked hard to make the It's a lot of code to get right. Daniel's screen shots above are how we would envisage this component be expanded to better cater for dates further away from today. Well, at least the year changer. The decade changer would be optional but nice. We would certainly be interested in a PR for this. PS: Currently there's a bug (reported as issue #97) where the datepicker doesn't jump to the date specified by the model and we'll be fixing this shortly. |
Just thinking out loud here:
Let's see how others solved it:
|
Thanks for persisting. In reality, we don't require a feature like this for our own purposes but clearly you and others do, so it should be done and we would accept a PR for this feature. We did load your gist and review it and would have the following additional requirements for a PR:
Perhaps you have already enhanced your version of the gist as originally presented so there may not be as much work to turn it into a PR? |
Would you consider adding the feature to allow edit date right in anchor-button part (that looks like input anyway)? Maybe optional feature by param? User would invoke date-picker by clicking on the zmdi-apps icon.
I have a working quick&dirty prototype of this in our project (I created editable anchor-input component similar to anchor-button) but I think it would be better if you do it in your style ;-)
The text was updated successfully, but these errors were encountered: