From d726c921eb5902483dfeb82383829e9309f6b65c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 21 Nov 2015 15:33:57 +0100 Subject: make calendar week start (sun or mon) configurable --- mod/events.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mod/events.php') diff --git a/mod/events.php b/mod/events.php index c3731bf1c..af5a9fc66 100755 --- a/mod/events.php +++ b/mod/events.php @@ -280,11 +280,14 @@ function events_content(&$a) { // $plaintext = false; + $first_day = get_pconfig(local_channel(),'system','cal_first_day'); + $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 + '$lang' => $a->language, + '$first_day' => (($first_day) ? $first_day : 0) )); $o =""; -- cgit v1.2.3 From 74b574d0b1874b0811837d9ac4472f1084800aeb Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 21 Nov 2015 23:49:29 +0100 Subject: datetimepicker should also respect first day of week setting --- mod/events.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mod/events.php') 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' => '*', '$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:'), -- cgit v1.2.3 From 4c84a2ce615be12adfbeb1067b5c6652330027bb Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 22 Nov 2015 00:13:33 +0100 Subject: update datetimepicker and fix it for finish date --- mod/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/events.php') diff --git a/mod/events.php b/mod/events.php index e07abbf46..7220a3d42 100755 --- a/mod/events.php +++ b/mod/events.php @@ -697,7 +697,7 @@ function events_content(&$a) { '$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',$first_day), + '$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','',false,$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:'), -- cgit v1.2.3