Block Saturdays in date field of concrete5 form block
Permalink 2 users found helpful
Hello Guys,
Can anyone help me with this topic?
I want to block all saturdays (day not selectable) on the date field of the concrete 5 form block.
Thanks ;)
Can anyone help me with this topic?
I want to block all saturdays (day not selectable) on the date field of the concrete 5 form block.
Thanks ;)
I think you gonna need a custom block for this.
hi
this is a hacky way to do such a thing, it's not perfect because user still can edit textfield (without using datepicker):
1- open file: /concrete/core/helpers/form/date_time.php
2- at line 204, find where datepicker defined:
and replace it with:
remember saturday is considered sixth day of the week, if u want to disable other days, change that number.
this is a hacky way to do such a thing, it's not perfect because user still can edit textfield (without using datepicker):
1- open file: /concrete/core/helpers/form/date_time.php
2- at line 204, find where datepicker defined:
$html .= '<script type="text/javascript">$(function() { $("#' . $id . '").datepicker({ dateFormat: \'' . DATE_APP_DATE_PICKER . '\', changeYear: true, showAnim: \'fadeIn\' }); });</script>';
and replace it with:
$html .= '<script type="text/javascript">$(function() { $("#' . $id . '").datepicker({ dateFormat: \'' . DATE_APP_DATE_PICKER . '\', changeYear: true, showAnim: \'fadeIn\', beforeShowDay: function(day) { var day = day.getDay(); if (day == 6) { return [false, "somecssclass"] } else { return [true, "someothercssclass"] } } }); });</script>';
remember saturday is considered sixth day of the week, if u want to disable other days, change that number.
Shahroq, great, this works and its true. Thanks :)
Hello, i want to disable sundays,how to do it? More.. its possible to disable specific days like the Holiddays? if ther is possible you can show how to make it? Thanks,
Luis
Luis