Skip to content
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

Start date #9

Closed
stifboy opened this issue Oct 15, 2020 · 6 comments
Closed

Start date #9

stifboy opened this issue Oct 15, 2020 · 6 comments

Comments

@stifboy
Copy link

stifboy commented Oct 15, 2020

Is there a way to add a start date or when the dates or calendar should start showing?

@dmuy
Copy link
Owner

dmuy commented Oct 15, 2020

You mean, like when the date picker opens it shows the specific month of a start date?

Can you elaborate on that? I didn't quite get what you mean.

@stifboy
Copy link
Author

stifboy commented Oct 15, 2020

You mean, like when the date picker opens it shows the specific month of a start date?

yes. Like when the date picker opens, it should show dates from October 2015 and below

@dmuy
Copy link
Owner

dmuy commented Oct 15, 2020

I see.

Currently there is no configuration on that. But, if there is no value (on the input) it will show the current date's month, otherwise it will show the selected date's month.

@dmuy
Copy link
Owner

dmuy commented Oct 15, 2020

yes. Like when the date picker opens, it should show dates from October 2015 and below

What you can do is set the default value and maxDate to October 31, 2015. (read more)

@stifboy
Copy link
Author

stifboy commented Oct 15, 2020

yes. Like when the date picker opens, it should show dates from October 2015 and below

What you can do is set the default value and maxDate to October 31, 2015. (read more)

Can I set the default value without adding it to the input field?

@dmuy
Copy link
Owner

dmuy commented Oct 15, 2020

Yes. By specifying the value configuration upon initialization

// default `format` config
duDatepicker('#datepicker', { value: '10/31/2015' });

// custom `format` config
duDatepicker('#datepicker', { format: 'yyyy-mm-dd', value: '2015-10-31' });

or calling setValue (after initialization)

duDatepicker('#datepicker', 'setValue', '10/31/2015');

Just remember that the value should be formatted like the format config

@dmuy dmuy closed this as completed Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants