How not restrict old date selection from Calender for a custom field

I want to have have old dates greyed out in the calender. Such that the used should not be able to select them.

I can do validation post selection, but that would be the user has to try a few dates before find out which date he can select.

this is something akin to travel booking websites where only available travel dates are shown.

Hi @dhananjay,

I don’t konw, how will worked in dialog but i share my custom/client script for previous date disable from date picker.

Please check it, we set in Todo list.

frappe.ui.form.on('ToDo', {
	refresh: function(frm) {
		frm.fields_dict.date.datepicker.update({ // Here date is the Todo field name.
            minDate: new Date(frappe.datetime.get_today()),
        });
	}
});

Maybe it helpful for you.

Thank You!

1 Like

Thanks, I think that should help