aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-11-21 23:49:29 +0100
committerMario Vavti <mario@mariovavti.com>2015-11-21 23:49:29 +0100
commit74b574d0b1874b0811837d9ac4472f1084800aeb (patch)
tree845996f86db36d7d7121074c870c82f63a931abb
parentd726c921eb5902483dfeb82383829e9309f6b65c (diff)
downloadvolse-hubzilla-74b574d0b1874b0811837d9ac4472f1084800aeb.tar.gz
volse-hubzilla-74b574d0b1874b0811837d9ac4472f1084800aeb.tar.bz2
volse-hubzilla-74b574d0b1874b0811837d9ac4472f1084800aeb.zip
datetimepicker should also respect first day of week setting
-rw-r--r--include/datetime.php4
-rwxr-xr-xmod/events.php7
2 files changed, 6 insertions, 5 deletions
diff --git a/include/datetime.php b/include/datetime.php
index b0167edb2..5ae33d1a0 100644
--- a/include/datetime.php
+++ b/include/datetime.php
@@ -198,7 +198,7 @@ function timesel($format, $h, $m, $id='timepicker') {
* @todo Once browser support is better this could probably be replaced with
* native HTML5 date picker.
*/
-function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
+function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false, $first_day = 0) {
$o = '';
$dateformat = '';
@@ -234,7 +234,7 @@ function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pic
$o .= "<div class='date'><input type='text' placeholder='$readable_format' name='$id' id='$id' $input_text />";
$o .= (($required) ? '<span class="required" title="' . t('Required') . '" >*</span>' : '');
$o .= '</div>';
- $o .= "<script type='text/javascript'>\$(function () {var picker = \$('#$id').datetimepicker({step:5,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs}); $extra_js})</script>";
+ $o .= "<script type='text/javascript'>\$(function () {var picker = \$('#$id').datetimepicker({step:5,timepickerScrollbar:false,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs,dayOfWeekStart:$first_day}); $extra_js})</script>";
return $o;
}
diff --git a/mod/events.php b/mod/events.php
index af5a9fc66..e07abbf46 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -281,13 +281,14 @@ function events_content(&$a) {
$first_day = get_pconfig(local_channel(),'system','cal_first_day');
+ $first_day = (($first_day) ? $first_day : 0);
$htpl = get_markup_template('event_head.tpl');
$a->page['htmlhead'] .= replace_macros($htpl,array(
'$baseurl' => $a->get_baseurl(),
'$editselect' => (($plaintext) ? 'none' : 'textareas'),
'$lang' => $a->language,
- '$first_day' => (($first_day) ? $first_day : 0)
+ '$first_day' => $first_day
));
$o ="";
@@ -692,11 +693,11 @@ function events_content(&$a) {
'$required' => '<span class="required" title="' . t('Required') . '">*</span>',
'$ModalCANCEL' => t('Cancel'),
'$ModalOK' => t('OK'),
- '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text',true,true,'','',true),
+ '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text',true,true,'','',true,$first_day),
'$n_text' => t('Finish date/time is not known or not relevant'),
'$n_checked' => $n_checked,
'$f_text' => t('Event Finishes:'),
- '$f_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$fyear+5),DateTime::createFromFormat('Y-m-d H:i',"$fyear-$fmonth-$fday $fhour:$fminute"),'finish_text',true,true,'start_text'),
+ '$f_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$fyear+5),DateTime::createFromFormat('Y-m-d H:i',"$fyear-$fmonth-$fday $fhour:$fminute"),'finish_text',true,true,'start_text',$first_day),
'$adjust' => array('adjust', t('Adjust for viewer timezone'), $a_checked, t('Important for events that happen in a particular place. Not practical for global holidays.'),),
'$a_text' => t('Adjust for viewer timezone'),
'$d_text' => t('Description:'),