aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-01-12 13:41:55 +0000
committerplegall <plg@piwigo.org>2011-01-12 13:41:55 +0000
commit0ef332fc0f78e36e168d51c9cf17df65ef0ab186 (patch)
treeb6e500c817d81b58ce73aa939fef422b18cd11a4 /include
parent66458980f3dd92d13df6bcb454ab99f39c15183c (diff)
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
Diffstat (limited to '')
-rw-r--r--include/calendar_monthly.class.php15
1 files changed, 11 insertions, 4 deletions
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'];