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

v4: can't set an min/maxDate with the onHide event #677

Closed
Jantastic opened this issue Dec 4, 2014 · 4 comments
Closed

v4: can't set an min/maxDate with the onHide event #677

Jantastic opened this issue Dec 4, 2014 · 4 comments
Assignees

Comments

@Jantastic
Copy link

I want to set the minDate and maxDate for two Datetimepickers.
It works fine if you use the onChange event, but if you use the onHide event, it crashes because the event param is undefined.

Error Message:
bootstrap-datetimepicker.js:1296 Uncaught TypeError: minDate() Could not parse date parameter: undefined

http://jsfiddle.net/jantastic/j4brdsnn/

Jan

@Eonasdan
Copy link
Owner

Eonasdan commented Dec 4, 2014

At this moment hide.dp does not include e.date. This can be accomplished by using

$("#datetimepicker3").on("hide.dp", function (e) {
    $('#datetimepicker4').data("DateTimePicker").minDate($("#datetimepicker3").data("DateTimePicker").date());
});

I am undecided if I think the hide event should include the current date. I could see the benefits in your situation.

@Jantastic
Copy link
Author

Yes, your solution works fine.

Good question, is it a big thing or why are you undecided?
Using the change event doesn't work in this case. The min and max value will be set by loading the page. So it's hard to change the date for the user.

@Eonasdan
Copy link
Owner

After thinking about it more, I think this could be implemented.

@Eonasdan Eonasdan reopened this Dec 11, 2014
@Eonasdan Eonasdan added this to the 4.0.0 milestone Dec 11, 2014
@Eonasdan Eonasdan self-assigned this Dec 11, 2014
Eonasdan added a commit that referenced this issue Jan 18, 2015
@Eonasdan
Copy link
Owner

Please check the latest, it should be fixed

@Eonasdan Eonasdan modified the milestones: 4.0.0, 4.1 Jan 19, 2015
@Eonasdan Eonasdan removed this from the 4.1 milestone Jan 21, 2015
@ghost ghost locked and limited conversation to collaborators Jun 17, 2017
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

2 participants