• 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: How to disable Sunday from calendar?

How to disable Sunday from calendar? 9 years 8 months ago #32014

  • sam.samiei
  • sam.samiei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 1
Hi,
How can i disable selection Sundays in calendar?

is the code below correct?

<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() == 7) {
alert('Please note that we are closed on Sundays');
return false;
} else {
return true;
}
}
</script>

thanks
The administrator has disabled public write access.

How to disable Sunday from calendar? 9 years 8 months ago #32023

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Your code checks for two days of the week (7 actually doesn't exist as the counting starts from 0).

Replace:
if (d.getDay() == 0 || d.getDay() == 7) {

With:
if (d.getDay() == 0) {
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
The following user(s) said Thank You: sam.samiei

How to disable Sunday from calendar? 9 years 8 months ago #32027

  • sam.samiei
  • sam.samiei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 1
Thanks for your reply.
i was wondering is it possible to make the Sundays not selectable? right now they can click on it and it shows them a message saying we are closed on Sunday. i would prefer disable the day rather than showing them a message on pop ups.

Sam
The administrator has disabled public write access.

How to disable Sunday from calendar? 9 years 8 months ago #32045

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can use the previous script along with a CSS approach on this:
.wd0{
  pointer-events: none !important;
  cursor: default !important;
}
.wd0 a:link{
  color:grey !important;
}
This is not official customer support. To receive your support, submit a support ticket here.
Last Edit: 9 years 8 months ago by adrianp.
The administrator has disabled public write access.
The following user(s) said Thank You: sam.samiei
  • 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!