mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Tidied up web interface to use standard dateformats
This commit is contained in:
@@ -48,13 +48,13 @@ if(is_admin() !== false) {
|
||||
<div class="form-group">
|
||||
<label for="start" class="col-sm-4 control-label">Start: </label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control date" id="start" name="start" value="<?php echo date('Y-m-d H:i'); ?>" data-date-format="YYYY-MM-DD HH:mm">
|
||||
<input type="text" class="form-control date" id="start" name="start" value="<?php echo date($config['dateformat']['byminute']); ?>" data-date-format="YYYY-MM-DD HH:mm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="end" class="col-sm-4 control-label">End: </label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control date" id="end" name="end" value="<?php echo date('Y-m-d H:i',strtotime('+1 hour')); ?>" data-date-format="YYYY-MM-DD HH:mm">
|
||||
<input type="text" class="form-control date" id="end" name="end" value="<?php echo date($config['dateformat']['byminute'],strtotime('+1 hour')); ?>" data-date-format="YYYY-MM-DD HH:mm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -208,7 +208,7 @@ $('#map-stub').typeahead({
|
||||
|
||||
$(function () {
|
||||
$("#start").datetimepicker({
|
||||
minDate: '<?php echo date('Y-m-d H:i'); ?>'
|
||||
minDate: '<?php echo date($config['dateformat']['byminute']); ?>'
|
||||
});
|
||||
$("#end").datetimepicker();
|
||||
$("#start").on("dp.change", function (e) {
|
||||
|
@@ -48,7 +48,7 @@ if ($_SESSION['userlevel'] >= "7")
|
||||
if ($vars['rev'] == $svnlog["rev"]) {
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
$linktext = "r" . $svnlog["rev"] . " <small>" . date("d M H:i", strtotime($svnlog["date"])) . "</small>";
|
||||
$linktext = "r" . $svnlog["rev"] . " <small>" . date($config['dateformat']['byminute'], strtotime($svnlog["date"])) . "</small>";
|
||||
echo(generate_link($linktext, array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'showconfig', 'rev' => $svnlog["rev"])));
|
||||
|
||||
if ($vars['rev'] == $svnlog["rev"]) {
|
||||
|
@@ -146,11 +146,11 @@ if (!$auth)
|
||||
echo('
|
||||
<div class="form-group">
|
||||
<label for="dtpickerfrom">From</label>
|
||||
<input type="text" class="form-control" id="dtpickerfrom" maxlength="16" value="' . date('Y-m-d H:i', $graph_array['from']) . '" data-date-format="YYYY-MM-DD HH:mm">
|
||||
<input type="text" class="form-control" id="dtpickerfrom" maxlength="16" value="' . date($config['dateformat']['byminute'], $graph_array['from']) . '" data-date-format="YYYY-MM-DD HH:mm">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dtpickerto">To</label>
|
||||
<input type="text" class="form-control" id="dtpickerto" maxlength=16 value="' . date('Y-m-d H:i', $graph_array['to']) . '" data-date-format="YYYY-MM-DD HH:mm">
|
||||
<input type="text" class="form-control" id="dtpickerto" maxlength=16 value="' . date($config['dateformat']['byminute'], $graph_array['to']) . '" data-date-format="YYYY-MM-DD HH:mm">
|
||||
</div>
|
||||
<input type="submit" class="btn btn-default" id="submit" value="Update" onclick="javascript:submitCustomRange(this.form);">
|
||||
</form>
|
||||
|
@@ -100,7 +100,7 @@ $(function () {
|
||||
if( $("#dtpickerto").val() != "" ) {
|
||||
$("#dtpickerfrom").data("DateTimePicker").maxDate($("#dtpickerto").val());
|
||||
} else {
|
||||
$("#dtpickerto").data("DateTimePicker").maxDate('<?php echo date('Y-m-d H:i'); ?>');
|
||||
$("#dtpickerto").data("DateTimePicker").maxDate('<?php echo date($config['dateformat']['byminute']); ?>');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@@ -638,6 +638,7 @@ $config['perf_times_purge'] = 30; # Number in days
|
||||
# Date format for PHP date()s
|
||||
$config['dateformat']['long'] = "r"; # RFC2822 style
|
||||
$config['dateformat']['compact'] = "Y-m-d H:i:s";
|
||||
$config['dateformat']['byminute'] = "Y-m-d H:i";
|
||||
$config['dateformat']['time'] = "H:i:s";
|
||||
|
||||
# Date format for MySQL DATE_FORMAT
|
||||
|
Reference in New Issue
Block a user