I am trying to disable/grey out public holidays and weekends in AEM forms datepicker. I am trying to add the code on the initialize method. Any snippets
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
@harshv7973321 : I think, this cannot be achieve through AEM datepicker component.
<input type="date" id="${guideid}${"_widget"}" name="${guide:encodeForHtmlAttr(guideField.name,xssAPI)}"
value="${guide:encodeForHtmlAttr(guideField.value,xssAPI)}" style="${guide:encodeForHtmlAttr(guideField.widgetInlineStyles,xssAPI)}"
min="${guide:encodeForHtmlAttr(guideField.minimumDate,xssAPI)}"
max="${guide:encodeForHtmlAttr(guideField.maximumDate,xssAPI)}"/>
we can pass only min and max .
If you still need to achieve , then you can try to implement customized datepicker for your use case.
Thanks,
Siva
I haven't tried this and don't have a reference implementation. Still, you can use moment.js as the client library[0] and make the necessary changes[1] for specific dates by defining an Array containing dates and using this Array to decide whether or not to disable dates.
[0] - https://forms.life/2020/06/10/adaptive-forms-date-techniques-with-moment-js/
@harshv7973321 : I think, this cannot be achieve through AEM datepicker component.
<input type="date" id="${guideid}${"_widget"}" name="${guide:encodeForHtmlAttr(guideField.name,xssAPI)}"
value="${guide:encodeForHtmlAttr(guideField.value,xssAPI)}" style="${guide:encodeForHtmlAttr(guideField.widgetInlineStyles,xssAPI)}"
min="${guide:encodeForHtmlAttr(guideField.minimumDate,xssAPI)}"
max="${guide:encodeForHtmlAttr(guideField.maximumDate,xssAPI)}"/>
we can pass only min and max .
If you still need to achieve , then you can try to implement customized datepicker for your use case.
Thanks,
Siva