Not select past date

i try this code this not working properly can any one help me plz

frappe.ui.form.on('Logistic Notice', {
	onload_post_render(frm) {
		frm.trigger('setup_proposed_shipping');
	},

	setup_proposed_shipping(frm) {
		let today = new Date();

		// setting datepicker options to set min date & min time
	
		frm.get_field('proposed_shipping').$input.datepicker({
			
			minDate: today,
			
			onSelect: function (fd, d, picker) {
				if (!d) return;
				var date = d.toDateString();
				if (date === today.toDateString()) {
				// 	picker.update({
				// 		minHours: (today.getHours() + 1)
				// 	});
				// } else {
					// picker.update({
					// 	minHours: 0
					// });
				}
				frm.get_field('proposed_shipping').$input.trigger('change');
			}
		});
	}

});
1 Like