Fix Graph date selector (#15956)

It did not handle strings like now and -2d
This commit is contained in:
Tony Murray 2024-04-19 10:22:06 -05:00 committed by GitHub
parent 03e9b52295
commit 36d14480f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@
<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);