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

Desactivate a full day (except weekends) #9

Closed
aymendhaya opened this issue Jul 17, 2016 · 3 comments
Closed

Desactivate a full day (except weekends) #9

aymendhaya opened this issue Jul 17, 2016 · 3 comments

Comments

@aymendhaya
Copy link

aymendhaya commented Jul 17, 2016

Hello developers,
here is my proposition:

disableValues: 
{
    datetime: [
        {
            val: "May 06,2015 02:30 AM"
        }
    ],

    day: [0, 6]                     
}

Why not having ability to put simply val: "May 06,2015" if we want to set a full day as Invalid ?

Have a good reception.

@nehakadam
Copy link
Owner

To keep it simple, Dates/Times/DateTimes in the dateTimeFormat are allowed to be specified as disableValues.

To set entire day as disabled value, you can use -

datetime: [
    {
        start: "01-03-2015 00:00",
        end: "01-03-2015 23:59"    
    }
]

@aymendhaya
Copy link
Author

aymendhaya commented Jul 17, 2016

Hello again,
Sorry for not getting it well, this is some details. If we consider that i have:

mode: "datetime",
dateTimeFormat: "dd/MM/yyyy",
inputDateTimeFormat: "dd/MM/yyyy",
minValue: new Date(2016, 00, 01),
maxValue: new Date(2016, 00, 15),

and i want to desactivate for example the entire 03/01/2016, what should i put in disableValues section ?
PS: i don't need time picker for this case.
Thank you in advance :)

@nehakadam
Copy link
Owner

You can achieve it with following code -

$(document).ready(function()
{
    $("#ip-de").AnyPicker(
    {

        mode: "datetime",

        dateTimeFormat: "dd/MM/yyyy",

        inputDateTimeFormat: "dd/MM/yyyy",

        selectedDate: "05/01/2016", 

        minValue: new Date(2016, 0, 01),

        maxValue: new Date(2016, 0, 15),

        disableValues: {

            date: [
                {
                    val: "03/01/2016"
                }
            ]
        }
    });
});

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