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
This commit is contained in:
plegall
2011-01-12 13:41:55 +00:00
parent 66458980f3
commit 0ef332fc0f
7 changed files with 70 additions and 4 deletions
+11 -4
View File
@@ -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'];