Skip to content

Commit

Permalink
Fix Graph date selector (librenms#15956)
Browse files Browse the repository at this point in the history
It did not handle strings like now and -2d
  • Loading branch information
murrant committed Apr 19, 2024
1 parent 03e9b52 commit 36d1448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/html/print-date-selector.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class="btn btn-default"
<script src="<?php echo asset('js/RrdGraphJS/moment-timezone-with-data.js'); ?>"></script>
<script type="text/javascript">
$(function () {
var ds_datefrom = new Date(<?php echo $graph_array['from']; ?>*1000);
var ds_dateto = new Date(<?php echo $graph_array['to']; ?>*1000);
var ds_datefrom = new Date(<?php echo \LibreNMS\Util\Time::parseAt($graph_array['from']); ?>*1000);
var ds_dateto = new Date(<?php echo \LibreNMS\Util\Time::parseAt($graph_array['to']); ?>*1000);
var ds_tz = '<?php echo session('preferences.timezone'); ?>';
if (ds_tz) {
ds_datefrom = moment.tz(ds_datefrom, ds_tz);
Expand Down

0 comments on commit 36d1448

Please sign in to comment.