diff options
-rw-r--r-- | views/default/input/date.php | 4 | ||||
-rw-r--r-- | views/default/input/datetime-local.php | 9 | ||||
-rw-r--r-- | views/default/input/datetime.php | 9 | ||||
-rw-r--r-- | views/default/input/month.php | 9 |
4 files changed, 25 insertions, 6 deletions
diff --git a/views/default/input/date.php b/views/default/input/date.php index b347f835d..7e35c7beb 100644 --- a/views/default/input/date.php +++ b/views/default/input/date.php @@ -7,4 +7,8 @@ $overrides = array( 'type' => 'date',
);
+if (isset($vars['value']) && is_int($vars['value'])) {
+ $vars['value'] = date("Y-m-d", $vars['value']);
+}
+
echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/datetime-local.php b/views/default/input/datetime-local.php index e3f7e1915..9b67a7b67 100644 --- a/views/default/input/datetime-local.php +++ b/views/default/input/datetime-local.php @@ -1,9 +1,14 @@ <?php
+$defaults = array(
+ 'placeholder' => 'yyyy-mm-ddThh:mm:ss+hh:mm',
+);
$overrides = array(
'type' => 'datetime-local',
);
-$args = array_merge($vars, $overrides);
+if (isset($vars['value']) && is_int($vars['value'])) {
+ $vars['value'] = date("c", $vars['value']);
+}
-echo elgg_view('input/default', $args);
\ No newline at end of file +echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/datetime.php b/views/default/input/datetime.php index 8cc9d9087..d7d0a4291 100644 --- a/views/default/input/datetime.php +++ b/views/default/input/datetime.php @@ -1,9 +1,14 @@ <?php
+$defaults = array(
+ 'placeholder' => 'yyyy-mm-ddThh:mm:ss',
+);
$overrides = array(
'type' => 'datetime',
);
-$args = array_merge($vars, $overrides);
+if (isset($vars['value']) && is_int($vars['value'])) {
+ $vars['value'] = date("Y-m-d\TH:i:s", $vars['value']);
+}
-echo elgg_view('input/default', $args);
\ No newline at end of file +echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/month.php b/views/default/input/month.php index cad6562a9..01ecae384 100644 --- a/views/default/input/month.php +++ b/views/default/input/month.php @@ -1,9 +1,14 @@ <?php
+$defaults = array(
+ 'placeholder' => 'yyyy-mm',
+);
$overrides = array(
'type' => 'month',
);
-$args = array_merge($vars, $overrides);
+if (isset($vars['value']) && is_int($vars['value'])) {
+ $vars['value'] = date("Y-m", $vars['value']);
+}
-echo elgg_view('input/default', $args);
\ No newline at end of file +echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file |