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

Dynamically set min & max on onSet #690

Open
S8nsick66 opened this issue Apr 28, 2015 · 4 comments
Open

Dynamically set min & max on onSet #690

S8nsick66 opened this issue Apr 28, 2015 · 4 comments

Comments

@S8nsick66
Copy link

Hello!

I have 2 date pickers, one is for start date and one is for end date. When I change start date, I want to set min on end date to that value. So users can't set an end date that is before the start date.

onSet: function(thingSet) {
    if(thingSet.select){
        end_picker.set({
            'min': start_picker.get('value'),
            'max': false
        });
    }
}

I have verified that start_picker and end_picker are correctly set (onStart). I have tried calling render, start and stop after setting but min is not changed.

Is there a way to accomplish what I want?

Thanks in advance!
/Dennis

@leph24
Copy link

leph24 commented May 21, 2015

#233

@akash-suthar
Copy link

$('.datepicker').on('change', function () {
if ($(this).attr('id') === 'datefrom') {
alert($(this).val())
$('#dateto').pickadate('picker').set('min',$(this).val());
}
if ($(this).attr('id') === 'dateto') {
$('#datefrom').pickadate('picker').set('max',$(this).val());
}
});

@4ndro1d
Copy link

4ndro1d commented Oct 25, 2016

Not working for me

@ompradeep
Copy link

@oozrafa #233 working for me

Thanks!

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

5 participants