Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Add "init-day" option for datePicker #1050

Closed
ariesjia opened this issue Sep 20, 2013 · 5 comments
Closed

Add "init-day" option for datePicker #1050

ariesjia opened this issue Sep 20, 2013 · 5 comments

Comments

@ariesjia
Copy link

If i set min date is "2014-05-01", I need to click multiple times to reach the place which is able

Because the initialization date has no relationship with min or max , also can't customized. just use the

selected = new Date()

@caitp
Copy link
Contributor

caitp commented Sep 20, 2013

Does it totally make sense for the date picker to change your model without user interaction?

@bekos
Copy link
Contributor

bekos commented Sep 20, 2013

@caitp I think @ariesjia talks about the initial month/year display of the datepicker. Currently, it's the current month/year, if no model value is assigned.

@ariesjia I understand your use case and this is not difficult to implement, but I don't know if another config option is the proper solution here. Perhaps the initial selection could me max(currentDate, minDate), but again I am not sure if this will confuse others.

You can achieve what you want if you set the model on the date you want to be displayed on the datepicker, and then on a $timeout assign the model to your desired value. I know it's not nice, but it's a solution.

Again, I am not sure if we want to support this, and if we do, will be with another option, a convention like max or another way. I would like to hear what others have to say.

@greengerong
Copy link

The “today” button can not be disabled or change to others when today is out of min date and max date.

@pkozlowski-opensource
Copy link
Member

@bekos IMO it makes sense to make sure that the initial selection (especially if it doesn't come from the model but is taken as the current date) falls within min / max range. As for the other option I'm, as you, unsure it it makes sense. But yeh, probably assuring that we display initial state within (min, max) range makes sense.

@bekos
Copy link
Contributor

bekos commented Feb 8, 2014

The 7f4b40e supports the init-date to specify the initial date view when no model value is set.

@bekos bekos closed this as completed Feb 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants