Datepicker - noWeekends, - Page 1

User 2077947 Photo


Registered User
40 posts

Has anybody managed to get datepicker to display 'No Weekends'?

As you can see from the jquery.ui.datepicker.js coding shown below, I have managed to successfully set the minDate to 1 and maxDate to 60days but if on line 92, I replace null with $.datepicker.noWeekends, the drop down calender will not appear on the form :(

89 minDate: 1, // The earliest selectable date, or null for no limit
90 maxDate: 60, // The latest selectable date, or null for no limit
91 duration: '_default', // Duration of display/closure
92 beforeShowDay: null, // Function that takes a date and returns an array with
93 // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
94 // [2] = cell title (optional), e.g. $.datepicker.noWeekends

The web form can be found here: http://www.skipy.co.uk/skip_online_order_form.html#top

I'm really puzzled as to why it won't work and would appreciate any advice.

Cheers

Skipy
R K BAILEY
User 187934 Photo


Senior Advisor
20,271 posts

Here maybe.
http://www.coffeecup.com/forums/web-for … _id=219100
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2077947 Photo


Registered User
40 posts

Hi Eric,

No, I was involved in that minDate maxDate problem and have solved that one.
It's this noWeekends problem that I can't solve.

It's so frustrating :(
R K BAILEY
User 187934 Photo


Senior Advisor
20,271 posts

You would take the same approach to get no weekends.;)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2077947 Photo


Registered User
40 posts

I agree but when I insert $.datepicker.noWeekends in place off null, the Drop Down Calender does not appear on my Form.


Can you get it to work on your (or any) Web-Form-Builder form by any chance?
R K BAILEY
User 187934 Photo


Senior Advisor
20,271 posts

Like this.:)
http://ericrohloff.com/coffeecup/ccforu … rweekends/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2077947 Photo


Registered User
40 posts

Yes Eric, if that calender showed that you also could not select today (Day 0) or anything after 60 days, that would be perfect but despite following your instructions re pasting the code into the page header and amending #item1_date to #item250_date_1, I'm still having no joy :(:(:(

I'm pasting this code;

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { // 0 = sunday, 1 = monday, 2 = tuesday, 3 = wednesday, // 4=thursday, 5 = friday, 6=satday var daysToDisable = [6, 0]; $('#item1_date').datepicker({ beforeShowDay: disableSpecificWeekDays, minDate: 0 }); function disableSpecificWeekDays(date) { var day = date.getDay(); for (i = 0; i < daysToDisable.length; i++) { if ($.inArray(day, daysToDisable) != -1) { return [false]; } } return [true]; } }); </script>

To be honest, I'm out of my depth here with this code but should '6=satday' be '6=saturday'? Not that it seems to make any difference when I amend it.

Is there any way you could look at my form and page to see where I'm going wrong. I'm pulling my hair out here :rolleyes:

I would be very grateful if this problem could be solved.
R K BAILEY
User 187934 Photo


Senior Advisor
20,271 posts

I don't see the code in this form.
http://skipyskiphire.coffeecup.com/form … rder_form/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2077947 Photo


Registered User
40 posts

This is the page containing the form;

http://www.skipy.co.uk/skip_online_order_form.html#top

Exported using File - Export - Automated Form Processing
R K BAILEY
User 187934 Photo


Senior Advisor
20,271 posts

I don't see the code I provided on there either.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.