From f7222bf601fa120a0fa2190cb98325780d75ff24 Mon Sep 17 00:00:00 2001 From: nikrou Date: Mon, 30 Nov 2009 20:41:11 +0000 Subject: Feature 1255 : sql functions for calendar (interval, year, month, ...) git-svn-id: http://piwigo.org/svn/trunk@4398 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/calendar_weekly.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/calendar_weekly.class.php') 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'] ) ); } -- cgit v1.2.3