• 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: Disabled weekdays

Disabled weekdays 7 years 9 months ago #37107

Hello,
Is something like this possible?
<script type="text/javascript">
jQuery(document).ready(function(){
  var myDisabledDates = ['weekDay == 1','weekDay == 2'];
  //the dates you want to disable
  myDateTPicker = RSFormPro.jQueryCalendar.calendars[4]['datum'];
  //replace 25 with your form ID and the date time picker name.
  myDateTPicker.calendarInstance.setOptions({
    disabledDates: myDisabledDates
  });
});
</script>
Last Edit: 7 years 9 months ago by adridebekker. Reason: wrong
The administrator has disabled public write access.

Disabled weekdays 7 years 9 months ago #37163

  • dragos
  • dragos's Avatar
  • OFFLINE
  • Administrator
  • Posts: 634
  • Thank you received: 117
Hello,

Your code will actually disable the Mondays and Tuesdays, the calendar count starts from Sunday, which is 0. In order to disable Saturdays and Sundays, you should try this instead:

www.rsjoomla.com/support/documentation/r...time-picker.html#dcw
The administrator has disabled public write access.

Disabled weekdays 7 years 9 months ago #37165

Hallo,
The code to block a weekday gives a popup message.
I prefer that you cann't select a weekday, just like the code to block a date.
The administrator has disabled public write access.

Disabled weekdays 7 years 9 months ago #37189

  • dragos
  • dragos's Avatar
  • OFFLINE
  • Administrator
  • Posts: 634
  • Thank you received: 117
Hello,

Visually disabling the weekend dates requires further development, you can try to refer at the following link for additional information, scripting examples and functions for the Date and Time Picker field:

xdsoft.net/jqplugins/datetimepicker/

However, you can drop the popup message by removing the following syntax from the above script:
alert('Please select another day than Saturday or Sunday.');
The administrator has disabled public write access.

Disabled weekdays 7 years 3 months ago #37734

  • info3222
  • info3222's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
Hi adridebekker,
have you solved the problem to disable all weekdays of the year (no message only disable) ?
Thanks in advance.
Bye.
The administrator has disabled public write access.

Disabled weekdays 7 years 3 months ago #37735

Hi
No i did not. It's not possible.
The administrator has disabled public write access.

Disabled weekdays 6 years 5 months ago #38591

  • skl_123
  • skl_123's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi, batter late than never...
Have you tried to set?

jQuery('#Form1 #elemeID').datetimepicker({
disabledWeekDays:[0,1,2] etc
});

PS. i also made it happen within the module by changing the disabledWeekDays as discribed in the RSform javascript modifications :)
BR
Last Edit: 6 years 5 months ago by skl_123.
The administrator has disabled public write access.

Disabled weekdays 4 years 6 months ago #40665

  • pat01
  • pat01's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 4
Hi

Old thread but it still might help someone... :)

Disable weekdays:
<script type="text/javascript">
// Disable weekdays
jQuery(document).ready(function(){
  myDateTPicker = RSFormPro.jQueryCalendar.calendars[14]['Cal4'];
  myDateTPicker.calendarInstance.setOptions({
    disabledWeekDays:[1,2,3,4,5]
  });
});
</script>

Disable weekends:
<script type="text/javascript">
// Disable Saturday and Sunday
jQuery(document).ready(function(){
  myDateTPicker = RSFormPro.jQueryCalendar.calendars[14]['Cal4'];
  myDateTPicker.calendarInstance.setOptions({
    disabledWeekDays:[0,6]
  });
});
</script>

Important:
To make it work replace 14 by the ID of your form and Cal4 by your calendar name.


Patrick
The administrator has disabled public write access.
The following user(s) said Thank You: adridebekker, oliver.muench
  • 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!