aboutsummaryrefslogtreecommitdiff
path: root/views/default/input/month.php
diff options
context:
space:
mode:
authorEvan Winslow <evan.b.winslow@gmail.com>2010-08-04 17:57:18 +0000
committerEvan Winslow <evan.b.winslow@gmail.com>2010-08-04 17:57:18 +0000
commitd29340b0fda7a768f6941088808de7e9e41aa616 (patch)
treee5c2f6bb72c995d2d8ca4d085d9f9359a85b0fca /views/default/input/month.php
parent73d0be2e63fdeed67193e1e89c859a09468a3c4d (diff)
downloadelgg-d29340b0fda7a768f6941088808de7e9e41aa616.tar.gz
elgg-d29340b0fda7a768f6941088808de7e9e41aa616.tar.bz2
Updating date-related inputs to accept timestamps as well as string input
Diffstat (limited to 'views/default/input/month.php')
-rw-r--r--views/default/input/month.php9
1 files changed, 7 insertions, 2 deletions
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