From 3171ffa46e645d9b65ebada9ac5eb9fc75542abd Mon Sep 17 00:00:00 2001 From: Marco Villegas Date: Sun, 11 Apr 2010 21:12:35 -0500 Subject: [PATCH] avoid timezone warnings --- date_api_sql.inc | 7 ++++--- includes/date_api_argument_handler.inc | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git date_api_sql.inc date_api_sql.inc index 6329672..4cc69ac 100644 --- date_api_sql.inc +++ date_api_sql.inc @@ -553,9 +553,10 @@ class date_sql_handler { $info['sep'] = array( 'year' => '', 'month' => '-', 'day' => '-', 'hour' => ' ', 'minute' => ':', 'second' => ':'); + $now = date_now(); $info['empty_now'] = array( - 'year' => date('Y'), 'month' => date('m'), 'day' => min('28', date('d')), - 'hour' => date('H'), 'minute' => date('i'), 'second' => date('s')); + 'year' => date_format_date($now, 'custom', 'Y'), 'month' => date_format_date($now, 'custom', 'm'), 'day' => min('28', date_format_date($now, 'custom', 'd')), + 'hour' => date_format_date($now, 'custom', 'H'), 'minute' => date_format_date($now, 'custom', 'i'), 'second' => date_format_date($now, 'custom', 's')); $info['empty_min'] = array( 'year' => '1000', 'month' => '01', 'day' => '01', 'hour' => '00', 'minute' => '00', 'second' => '00'); @@ -886,4 +887,4 @@ class date_sql_handler { $now = date_now(); return array($now, $now); } -} \ No newline at end of file +} diff --git includes/date_api_argument_handler.inc includes/date_api_argument_handler.inc index cda34e3..ca3d1f2 100644 --- includes/date_api_argument_handler.inc +++ includes/date_api_argument_handler.inc @@ -145,7 +145,7 @@ class date_api_argument_handler extends views_handler_argument_date { */ function get_default_argument($raw = FALSE) { if (!$raw && $this->options['default_argument_type'] == 'date') { - return date($this->format(), time()); + return date_format_date(date_now(), 'custom', $this->format()); } else { return parent::get_default_argument($raw); -- 1.7.0