summaryrefslogtreecommitdiff
path: root/includes/sys_form.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-08 12:48:08 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-09 12:11:12 +0200
commit222c9fed7d4ca2b3b44c05907fbb7080c1efd342 (patch)
tree62b1bfa9233000985331b9dea703d51dc24515a2 /includes/sys_form.php
parent2d6bca1357faff28bc1f86a56b432cc463ff7574 (diff)
parent8257864829ffdfb410f05e0dd0a9c781f48b741a (diff)
Merge remote-tracking branch 'MyIgel/templating'
Diffstat (limited to 'includes/sys_form.php')
-rw-r--r--includes/sys_form.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/includes/sys_form.php b/includes/sys_form.php
index c974c1d1..cd1c84e6 100644
--- a/includes/sys_form.php
+++ b/includes/sys_form.php
@@ -66,6 +66,9 @@ function form_date($name, $label, $value, $start_date = '', $end_date = '')
$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) : '';
+ $locale = $locale = session()->get('locale');
+ $shortLocale = substr($locale, 0, 2);
+
return form_element($label, '
<div class="input-group date" id="' . $dom_id . '">
<input name="' . $name . '" class="form-control" value="' . htmlspecialchars($value) . '">'
@@ -73,13 +76,13 @@ function form_date($name, $label, $value, $start_date = '', $end_date = '')
</div>
<script type="text/javascript">
$(function(){
- $(\'#' . $dom_id . '\').datepicker({
- language: \'' . locale_short() . '\',
- todayBtn: \'linked\',
- format: \'yyyy-mm-dd\',
- startDate: \'' . $start_date . '\',
- endDate: \'' . $end_date . '\',
- orientation: \'bottom\'
+ $("#' . $dom_id . '").datepicker({
+ language: "' . $shortLocale . '",
+ todayBtn: "linked",
+ format: "yyyy-mm-dd",
+ startDate: "' . $start_date . '",
+ endDate: "' . $end_date . '",
+ orientation: "bottom"
});
});
</script>