diff --git a/includes/html/pages/devices.inc.php b/includes/html/pages/devices.inc.php
index e44d53af5ec9..5a69891f91c0 100644
--- a/includes/html/pages/devices.inc.php
+++ b/includes/html/pages/devices.inc.php
@@ -55,7 +55,7 @@
if ($vars['format'] == 'graph_' . $option) {
$listoptions .= '';
}
diff --git a/includes/html/pages/graphs.inc.php b/includes/html/pages/graphs.inc.php
index eccbcddd465d..8ff59e0ed337 100644
--- a/includes/html/pages/graphs.inc.php
+++ b/includes/html/pages/graphs.inc.php
@@ -15,10 +15,10 @@
}
if (!is_numeric($vars['from'])) {
- $vars['from'] = $config['time']['day'];
+ $vars['from'] = strtotime($vars['from']) ?: Config::get('time.day');
}
if (!is_numeric($vars['to'])) {
- $vars['to'] = $config['time']['now'];
+ $vars['to'] = strtotime($vars['to']) ?: Config::get('time.now');
}
preg_match('/^(?P[A-Za-z0-9]+)_(?P.+)/', $vars['type'], $graphtype);