Tagged: datepicker, disable
-
AuthorPosts
-
December 18, 2016 at 11:59 am #725820
Hi, similar to this post, I would like to disable specific dates in the datepicker, say 2016-12-26. Can you help out? Grazie!
-
This topic was modified 8 years, 10 months ago by
lijndiensten. Reason: sent to early :/
December 21, 2016 at 4:48 pm #727137Hey lijndiensten,
Please replace
beforeShowDay: function(date) { var day = date.getDay(); return [(day != 2)]; },with following one
beforeShowDay: function(date) { var day = date.getDay(); function IsChristmas(date) { var day = date.getDate(); var month = date.getMonth() + 1; return (day === 26 && month === 12); } return [(day != 0 && !IsChristmas(date))]; },Best regards,
YigitDecember 21, 2016 at 6:39 pm #727217Hi Yigit,
Thanks a lot for your help. This blocks Dec. 26, but does not block Tuesdays. Is there a way to do both?
Thanks,
IvanDecember 21, 2016 at 7:01 pm #727224Hey!
Oh sorry. Please change the code to following one
beforeShowDay: function(date) { var day = date.getDay(); function IsChristmas(date) { var day = date.getDate(); var month = date.getMonth() + 1; return (day === 26 && month === 12); } return [(day != 2 && !IsChristmas(date))]; },Cheers!
YigitDecember 21, 2016 at 7:12 pm #727238You are my javascript-hero, many thanks.
Enjoy the holidays :)
IvanDecember 21, 2016 at 7:13 pm #727240Hey!
You are welcome! :)
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Happy holidays!
Regards,
Yigit -
This topic was modified 8 years, 10 months ago by
-
AuthorPosts
- The topic ‘Disable specific dates in datepicker’ is closed to new replies.
