Hello everyone,
I've been asked in my company to do some customizations into Mantis 2.3.0, and one of it is about preventing the user to select a date after the today date.
Unfortunately so far I've not been able to do so with the following suggestions found into the net:
## Using the maxDate attribute through Javascript ##
$(function() {
$( "#datepicker" ).datepicker({ maxDate: new Date });
});
##Using the data-date-start-date and data-date-end-date attributes directly into my inputs##
data-date-start-date="0d"
data-date-end-date="0d"
##Using the endDate attribute through Javascript ##
$(function() {
$( "#datepicker" ).datepicker({
endDate: +0d });
});
Is there anyone who has found a solution please ?
Thanks in advance for your help,
Datetimepicker custom date range
Moderators: Developer, Contributor
Re: Datetimepicker custom date range
Finally one of my colleague has found the solution, so I share it with you here:
Here's the site where we found the solution:
https://eonasdan.github.io/bootstrap-datetimepicker/
Code: Select all
var today= new Date();
$('#myDateTime').data("DateTimePicker").maxDate(today);
https://eonasdan.github.io/bootstrap-datetimepicker/