Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I am using the datepicker from angular ui bootstrap and I need to apply 2 conditions, the first condition is that all days greater than today must be disable, this is easy, all I have to do is this:

 $scope.dateOptions = {
            formatYear: 'yyyy',
            maxDate: new Date(),
            startingDay: 1
        };

But the second condition is the next; I have two ENABLE the next weekend ignoring the first condition. How can I do this?

share|improve this question
    
You could look into momentjs. It provides the functionality to get dates by day of week and then leverage that output to disable dates not in the list you generate with it. – tuckerjt07 Aug 26 at 3:26
    
Ok, thanks, so this is not posible in the datapicker from angular ui ?? – user953851 Aug 26 at 11:01

Go with basic java script as

 $scope.dateOptions = {
        formatYear: 'yyyy',
        maxDate: new Date("October 13, 2016 11:13:00"),
        startingDay: 1
    };   

follow this link for requied date format

Angular Js Date Formats

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.