Limit date range and only reload page after change is done

This commit is contained in:
digital-gnome 2017-12-17 16:44:57 -05:00
parent 173ad4f75a
commit 804339f54f
2 changed files with 23 additions and 4 deletions

View File

@ -765,8 +765,27 @@ function initPage() {
//setFit(fitMode); // will redraw
//setLive(liveMode); // will redraw
redrawScreen();
$j('#minTime').datetimepicker({timeFormat: "HH:mm:ss", dateFormat: "yy-mm-dd"});
$j('#maxTime').datetimepicker({timeFormat: "HH:mm:ss", dateFormat: "yy-mm-dd"});
$j('#minTime').datetimepicker({
timeFormat: "HH:mm:ss",
dateFormat: "yy-mm-dd",
maxDate: +0,
onClose: function (newDate, oldData) {
if (newDate !== oldData.lastVal) {
changeDateTime();
}
}
});
$j('#maxTime').datetimepicker({
timeFormat: "HH:mm:ss",
dateFormat: "yy-mm-dd",
minDate: $j('#minTime').val(),
maxDate: +0,
onClose: function (newDate, oldData) {
if (newDate !== oldData.lastVal) {
changeDateTime();
}
}
});
}
window.addEventListener("resize",redrawScreen);
// Kick everything off

View File

@ -218,8 +218,8 @@ xhtmlHeaders(__FILE__, translate('MontageReview') );
<div id="header">
<?php echo $filter_bar ?>
<div id="DateTimeDiv">
<input type="text" name="minTime" id="minTime" value="<?php echo preg_replace('/ /', ' ', $minTime ) ?>" onchange="changeDateTime(this);"> to
<input type="text" name="maxTime" id="maxTime" value="<?php echo preg_replace('/ /', ' ', $maxTime ) ?>" onchange="changeDateTime(this);">
<input type="text" name="minTime" id="minTime" value="<?php echo preg_replace('/T/', ' ', $minTime ) ?>"> to
<input type="text" name="maxTime" id="maxTime" value="<?php echo preg_replace('/T/', ' ', $maxTime ) ?>">
</div>
<div id="ScaleDiv">
<label for="scaleslider"><?php echo translate('Scale')?></label>