summaryrefslogtreecommitdiff
path: root/includes/sys_form.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/sys_form.php')
-rw-r--r--includes/sys_form.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/includes/sys_form.php b/includes/sys_form.php
index edf9542a..a1b78b70 100644
--- a/includes/sys_form.php
+++ b/includes/sys_form.php
@@ -1,5 +1,6 @@
<?php
// Methods to build a html form.
+use Carbon\Carbon;
/**
* Renders a hidden input
@@ -63,6 +64,7 @@ function form_spinner($name, $label, $value)
function form_date($name, $label, $value, $start_date = '', $end_date = '')
{
$dom_id = $name . '-date';
+ $value = ($value instanceof Carbon) ? $value->getTimestamp() : $value;
$value = is_numeric($value) ? date('Y-m-d', $value) : '';
$start_date = is_numeric($start_date) ? date('Y-m-d', $start_date) : '';
$end_date = is_numeric($end_date) ? date('Y-m-d', $end_date) : '';