The DateTimePicker is available for UI customization that can be achieved by using available properties and events in the component.
The DateTimePicker is available for UI customization based on your application requirements. It can be achieved by using renderDayCell event that provides an option to customize each day cell on rendering.
The following example disables the weekends of every month by using renderDayCell
event.
@Html.EJS().DateTimePicker("datetimepicker").Placeholder("Select a date and time").RenderDayCell("onRenderCell").Render()
<script>
function onRenderCell(args) {
if (args.date.getDay() == 0 || args.date.getDay() == 6) {
//sets isDisabled to true to disable the date.
args.isDisabled = true;
}
}
</script>