From 53737666c64a5670d661ece071f5b913e45f195a Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Sun, 12 Jul 2015 13:45:47 +0200 Subject: add bootstrap datepicker --- includes/sys_template.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'includes/sys_template.php') diff --git a/includes/sys_template.php b/includes/sys_template.php index 1c3b38b1..452e3a82 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -122,6 +122,35 @@ function form_spinner($name, $label, $value) { '); } +/** + * Render a bootstrap datepicker + * + * @param string $name + * Name of the parameter + * @param string $label + * Label + * @param int $value + * Unix Timestamp + * @return HTML + */ +function form_date($name, $label, $value) { + $id = $name . '-date'; + $value = is_numeric($value) ? date('Y-m-d', $value) : ''; + return form_element($label, ' +
+ ' . glyph('th') . ' +
+ + ', $id); +} + /** * Rendert eine Liste von Checkboxen für ein Formular * -- cgit v1.2.3-54-g00ecf