• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Disable saturday and sunday in the calendar

Disable saturday and sunday in the calendar 4 years 4 days ago #41190

  • contact827
  • contact827's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 61
  • Thank you received: 3
Hi
To disable the weekend in the calendar,
  1. In which field exactly to put this code
  2. How to change it for saturday and Sunday, please ?
<script type="text/javascript">
  function rsfp_onSelectDate(date, type, args, calendar)
{
var dates = args[0];
var date = dates[0];
var year = date[0], month = date[1], day = date[2];
 
var d = new Date(year, month-1, day);
if (d.getDay() == 0 || d.getDay() == 1) {
alert('Please select a date that is different from Saturday or Sunday');
return false;
} else {
return true;
}
}

I tested the 3 fields of the tabs </> Sript PHP, and the 2 fields of </>PHP scripts - Pre-processing. No result.
Last Edit: 4 years 4 days ago by contact827.
The administrator has disabled public write access.

Disable saturday and sunday in the calendar 4 years 4 days ago #41192

  • djseleco
  • djseleco's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 47
  • Thank you received: 10
You have to paste this code in Javascript tab that you can find on "CSS and Javascript" option (see the photo)


<script type="text/javascript">
  function rsfp_onSelectDate(date, type, args, calendar)
{
var dates = args[0];
var date = dates[0];
var year = date[0], month = date[1], day = date[2];
 
var d = new Date(year, month-1, day);
if (d.getDay() == 0 || d.getDay() == 6) {
alert('Please select a date that is different from Saturday or Sunday!');
return false;
} else {
return true;
}
}
</script>
The administrator has disabled public write access.

Disable saturday and sunday in the calendar 4 years 4 days ago #41195

  • contact827
  • contact827's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 61
  • Thank you received: 3
OK. I was in the wrong field.
But no change on the "Date and time picker" in the form.

And, to disable saturday and sunday, if finally I can make it working, which number to replace in :
if (d.getDay() == 0 || d.getDay() == 6)
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!