From 0ef332fc0f78e36e168d51c9cf17df65ef0ab186 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 12 Jan 2011 13:41:55 +0000 Subject: feature 2103 added: week may start on sunday/monday in the monthly calendar git-svn-id: http://piwigo.org/svn/trunk@8626 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/calendar_monthly.class.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include/calendar_monthly.class.php') diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php index 1f7fdeee7..b3911ddb8 100644 --- a/include/calendar_monthly.class.php +++ b/include/calendar_monthly.class.php @@ -330,7 +330,7 @@ function build_year_calendar(&$tpl_var) function build_month_calendar(&$tpl_var) { - global $page; + global $page, $lang, $conf; $query='SELECT '.pwg_db_get_dayofmonth($this->date_field).' as period, COUNT(DISTINCT id) as count'; @@ -368,9 +368,12 @@ SELECT id, file,tn_ext,path, width, height, '.pwg_db_get_dayofweek($this->date_f $items[$day]['width'] = $row['width']; $items[$day]['height'] = $row['height']; $items[$day]['dow'] = $row['dow']; - } - global $lang, $conf; + if ('sunday' == $conf['week_starts_on']) + { + $items[$day]['dow']++; + } + } if ( !empty($items) and $conf['calendar_month_cell_width']>0 @@ -395,7 +398,11 @@ SELECT id, file,tn_ext,path, width, height, '.pwg_db_get_dayofweek($this->date_f { $first_day_dow -= 1; } - array_push( $wday_labels, array_shift($wday_labels) ); + + if ('monday' == $conf['week_starts_on']) + { + array_push( $wday_labels, array_shift($wday_labels) ); + } // END - pass now in week starting Monday $cell_width = $conf['calendar_month_cell_width']; -- cgit v1.2.3