Index: date_api_argument_handler.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/date/includes/date_api_argument_handler.inc,v retrieving revision 1.1.2.44 diff -u -r1.1.2.44 date_api_argument_handler.inc --- date_api_argument_handler.inc 12 Aug 2010 22:32:58 -0000 1.1.2.44 +++ date_api_argument_handler.inc 9 Sep 2010 14:03:00 -0000 @@ -147,7 +147,20 @@ */ function get_default_argument($raw = FALSE) { if (!$raw && $this->options['default_argument_type'] == 'date') { - return date($this->format(), time()); + $arg = date($this->format(), time()); + + //If default argument granularity is 'week' and the site is NOT using ISO8601 dates, + //we need to do some trickery so the correct week is is returned by the view + $parts = $this->date_handler->arg_parts($arg); + if($parts[0]['date']['week'] && !variable_get('date_api_use_iso8601', FALSE)){ + $year = date("Y"); + $last_week_of_year = date("W",strtotime(($year-1)."-"."12-31")); + $last_day_of_year = date("w",strtotime(($year-1)."-"."12-31")); + if ($last_day_of_year > 3 and $week != $last_week_of_year) { + $arg = date($this->format(),time()+7*24*60*60); + } + } + return $arg; } else { return parent::get_default_argument($raw);