Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8112821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:38:18+00:00 2026-06-06T02:38:18+00:00

I am working on ASP.net Webform application where i need to block certain dates

  • 0

I am working on ASP.net Webform application where i need to block certain dates and Weekend as Friday & Saturday.

Following Code works fine, It block the dates but by default blocks Saturday & Sunday as weekend while i need to block all Fridays & Saturdays on calendar.

I would appreciate fix to this particular code. I am not sure if jQuery Calendar has a built-in property to specify different weekends

var holiDays = [[2012, 07, 06, 'New Years Day'], [2012, 07, 14, 'Event XYZ'], [2011, 17, 25, 'Christmas Day']];
$(function () {
    $("#<%=txtBookDate.ClientID %>").datepicker({
        dateFormat: "yy-mm-dd",
        minDate: "-0d",
        maxDate: "+60d",
        beforeShowDay: noWeekendsOrHolidaysOrBlockedDates
    });

    function noWeekendsOrHolidaysOrBlockedDates(date) {
        var noWeekend = jQuery.datepicker.noWeekends(date);
        return noWeekend[0] ? setHoliDays(date) : noWeekend;
    }

    // set holidays function which is configured in beforeShowDay
    function setHoliDays(date) {
        for (i = 0; i < holiDays.length; i++) {
            if (date.getFullYear() == holiDays[i][0]
  && date.getMonth() == holiDays[i][1] - 1
  && date.getDate() == holiDays[i][2]) {
                return [false, 'holiday', holiDays[i][3]];
            }
        }
        return [true, ''];
    }


});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:38:21+00:00Added an answer on June 6, 2026 at 2:38 am

    Do you not have access to the jQuery UI source? Odd, because it is javascript, and usually freely available:

    /* Set as beforeShowDay function to prevent selection of weekends.
       @param  date  Date - the date to customise
       @return [boolean, string] - is this date selectable?, what is its CSS class? */
    noWeekends: function(date) {
        var day = date.getDay();
        return [(day > 0 && day < 6), ''];
    }
    

    Looks pretty well non-customizable, but relatively easy to reimplement as your own function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an ASP.NET WebForm application using MVP pattern. For every Web
I am working on an ASP.NET MVC application where I need to export data
I'm working on an ASP.NET WebForms CMS application, and having a bit of trouble
Good Morning, I'm working on an ASP.NET 3.5 webforms application and have written the
I've been working with ASP.NET(WebForm) for a while, but new to ASP.NET MVC. From
I'm working on an ASP.NET MVC 3 application. I primarily come from a ASP.NET
I'm working on an application using ASP.NET MVC 1.0 and I'm trying to inject
I'm working on an ASP.Net application and working to add some Ajax to it
I'm working on an application (ASP.NET, Webforms) that generates a list of outputs based
Response.Redirect() no longer working when upgrade the application to ASP.NET 4.0 Response.Redirect() is used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.