summaryrefslogtreecommitdiff
path: root/includes/sys_template.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2015-07-12 14:45:58 +0200
committerPhilip Häusler <msquare@notrademark.de>2015-07-12 14:45:58 +0200
commit8c518d4c3496ce9c72e4eed400923bd978b4e6a5 (patch)
tree6d28b53c22f9716d79398f5616a634ed2db3a08b /includes/sys_template.php
parent66c7e67a038b24ef9788d2550da15b2209c08123 (diff)
add arrival date feature
Diffstat (limited to 'includes/sys_template.php')
-rw-r--r--includes/sys_template.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/includes/sys_template.php b/includes/sys_template.php
index 452e3a82..1c631dbe 100644
--- a/includes/sys_template.php
+++ b/includes/sys_template.php
@@ -131,20 +131,25 @@ function form_spinner($name, $label, $value) {
* Label
* @param int $value
* Unix Timestamp
+ * @param int $min_date
+ * Earliest possible date
* @return HTML
*/
-function form_date($name, $label, $value) {
+function form_date($name, $label, $value, $start_date = '') {
$id = $name . '-date';
$value = is_numeric($value) ? date('Y-m-d', $value) : '';
+ $start_date = is_numeric($start_date) ? date('Y-m-d', $start_date) : '';
return form_element($label, '
<div class="input-group date" id="' . $id . '">
- <input type="text" class="form-control" value="' . $value . '"><span class="input-group-addon">' . glyph('th') . '</span>
+ <input type="text" name="' . $name . '" class="form-control" value="' . $value . '"><span class="input-group-addon">' . glyph('th') . '</span>
</div>
<script type="text/javascript">
$(function(){
$("#' . $id . '").datepicker({
language: "' . locale_short() . '",
- format: "yyyy-mm-dd"
+ todayBtn: "linked",
+ format: "yyyy-mm-dd",
+ startDate: "' . $start_date . '"
});
});
</script>