aboutsummaryrefslogtreecommitdiffstats
path: root/include/calendar_weekly.class.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2009-11-30 20:41:11 +0000
committernikrou <nikrou@piwigo.org>2009-11-30 20:41:11 +0000
commitf7222bf601fa120a0fa2190cb98325780d75ff24 (patch)
tree418abf0dc0cf2b6723aa8e8db64a399ee923f071 /include/calendar_weekly.class.php
parent2f8800b35b51fb71d8d61b1f809b28a5097c5801 (diff)
Feature 1255 :
sql functions for calendar (interval, year, month, ...) git-svn-id: http://piwigo.org/svn/trunk@4398 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/calendar_weekly.class.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/calendar_weekly.class.php b/include/calendar_weekly.class.php
index 14f6ccd8d..a8a167679 100644
--- a/include/calendar_weekly.class.php
+++ b/include/calendar_weekly.class.php
@@ -50,22 +50,22 @@ class Calendar extends CalendarBase
$this->calendar_levels = array(
array(
- 'sql'=> 'YEAR('.$this->date_field.')',
+ 'sql'=> pwg_db_get_year($this->date_field),
'labels' => null
),
array(
- 'sql'=> 'WEEK('.$this->date_field.')+1',
+ 'sql'=> pwg_db_get_week($this->date_field)+1,
'labels' => $week_no_labels,
),
array(
- 'sql'=> 'DAYOFWEEK('.$this->date_field.')-1',
+ 'sql'=> pwg_db_get_dayofweek($this->date_field)-1,
'labels' => $lang['day']
),
);
//Comment next lines for week starting on Sunday or if MySQL version<4.0.17
//WEEK(date,5) = "0-53 - Week 1=the first week with a Monday in this year"
- $this->calendar_levels[CWEEK]['sql'] = 'WEEK('.$this->date_field.',5)+1';
- $this->calendar_levels[CDAY]['sql'] = 'WEEKDAY('.$this->date_field.')';
+ $this->calendar_levels[CWEEK]['sql'] = pwg_db_get_week($this->date_field, 5).'+1';
+ $this->calendar_levels[CDAY]['sql'] = pwg_db_get_weekday($this->date_field);
array_push( $this->calendar_levels[CDAY]['labels'],
array_shift( $this->calendar_levels[CDAY]['labels'] ) );
}