Disable sundays
-
Is there a way to disable sundays in datepicker?
-
Did you open up the images I send in another tab so you can see them full resolution?
I can only think of not having the proper tags applied in “master”. Can you send screenshots of your settings in contact form 7 and in CJT?
- This reply was modified 8 years, 1 month ago by DikkieDick.
can you use double ampersand characters instead
- This reply was modified 8 years, 1 month ago by movingmagic.
- This reply was modified 8 years, 1 month ago by movingmagic.
- This reply was modified 8 years, 1 month ago by movingmagic.
I see what you mean. That was caused by the copy-paste. Modified it, but still the same.
Don’t ask me why or how but after some copy-pastes I don’t see any difference but it is working and only Wednesdays or shown.
Great! Fantastic! I am so glad! Good luck! Don’t forget that you can add any custom css snippets to the cjt plugin too. So the custom css field of your theme can stay empty.
Thanx. Don’t know what the change was that it succeeded. Actually very weird. Now the following to disable specific days as well. That trick isn’t working yet. With the holiday dates… If I try this then all dates can be chosen. Well if someone applies for a date which happens to be a holiday we can always mail him/her. Guess it won’t happend that often. ??
Update: Sometimes it’s so simple. Instead of disabling six days enabling one day is syntactically easier ?? :
jQuery(function($){
$(“#woensdag”).datepicker({
beforeShowDay: function(date){
var day = date.getDay();
return [day == 3];
}});
});- This reply was modified 8 years, 1 month ago by DikkieDick.
Thank you guys for this. This is exactly what I needed as well!
I did notice when copy – Paste if the tabs or spaces are not correct in the code it did not work for me…
jQuery(function($){ $("#woensdag").datepicker({ beforeShowDay: function(date){ var day = date.getDay(); //return [day == 3]; return [day != 0 && day != 5 && day != 6]; }}); });
- This reply was modified 8 years, 1 month ago by ryancooper76.
Hi folks,
I’ve tried blocking out a range of dates 24-12 to 31-12 and have a form in the footer of my site. I am unable to block out anything.
I’ve applied the code to the entire site as I cannot see how to apply it to footer only.
My steps so far:
1. Installed the CJT plugin.
2. Create a block code with the following codejQuery(function($){ var holidayDates = [“24-12”, “31-12”]; // define your holidays here $(“#brengdatum,”).datepicker({ numberOfMonths: 1, beforeShowDay: function(date) { var day = date.getDay(), dm = date.getDate() + “-” + (date.getMonth() + 1); var isHoliday = ($.inArray(dm, holidayDates) != -1); return [day != 0 && !isHoliday]; }}); });
3. Added this into the Contact Form for the footer
Reservation date and time<br /> [datetime datetime-717 id:brengdatum date-format:dd/mm/yy time-format:HH:mm min-hour:9 max-hour:23 step-minute:15 first-day:1]
Any ideas why this is not working?
In CJT on the code block bar is a H that you can click to change it into F. H is for header. F is for footer.
As far as I know, the dates should be in the format “dd-mm-yyyy” and you will have to enter each day of your holiday, not as a range.
And you should change “#brengdatum,” into the name of your own date ID assigned on your form to that field. And don’t use the comma there.Hope this helps a bit ??
can I create start date and end date
I needs End date will not allow past start days
How can i achive
Thanks
Then you use ONE datepicker? For one date?
I do not understand your question.
`- This reply was modified 7 years, 10 months ago by movingmagic.
- This reply was modified 7 years, 10 months ago by movingmagic.
- This reply was modified 7 years, 10 months ago by movingmagic.
I have two datepickers named startdate and enddate
Start Date:
for example if i selected 25/1/2017 from start date datepicker
End date:
When Select End date it should be disabled before 25/1/2017 and shows from 25/1/2017 to all dates
validation conditions which are,
1.Start date should not greater than end date.
2.End date should not less then start date.I have two datepickers named startdate and enddate
Start Date:
for example if i selected 25/1/2017 from startdate datepicker
End date:
When Select End date it should be disabled before 25/1/2017 and shows from 25/1/2017 to all dates
validation conditions which are,
1.Start date should not greater than end date.
2.End date should not less then start date.Yes, that you can do with this:
jQuery(function($){ var start = $('.startdate input').first(); var end = $('.enddate input').first(); start.on('change', function() { var start_date = $(this).datepicker('getDate'); start_date.setDate(start_date.getDate() + 1); end.datepicker('option', 'minDate', start_date); }); });
- The topic ‘Disable sundays’ is closed to new replies.