commit db9ffd179728f38b20d28522af9862b4406063dd
Author: Assos Assos <assos+forge@centrale-marseille.fr>
Date:   Wed Jul 30 22:30:14 2014 +0200

    Weekly update of contrib modules

diff --git a/drupal7/sites/all/modules/date/CHANGELOG.txt b/drupal7/sites/all/modules/date/CHANGELOG.txt
index 8c001610..e5e655e2 100644
--- a/drupal7/sites/all/modules/date/CHANGELOG.txt
+++ b/drupal7/sites/all/modules/date/CHANGELOG.txt
@@ -1,6 +1,28 @@
 Date Module 7.x
 =================
 
+======================
+Version 7.x-2.8
+======================
+- Issue #106713 by vijaycs85, heddn: Date Field title XSS(SA)
+- Issue #2310123 by Temoor: Fixed Fatal error in Migrate UI by Date Migrate Example.
+- Issue #2142277 by Temoor | lliss: Fixed Infinite Loop When Using Repeating Dates.
+- Issue #1871136 by Temoor | funkimunky: Fixed Cannot remove migrate example content type.
+- Issue #2261395 by minorOffense | kristofferwiklund: Fixed date_now is not respecting changes to timezone.
+- Issue #1832400 by imot3k, balintk: Fixed "The year/month/... is missing" error message is not translatable.
+- Issue #998076 by coredumperror, joelcollinsdc, brenk28: Fixed Problem with timezone handling (caused by date_get_timezone_db returning only UTC).
+- Issue #1976014 by Harmageddon: Remove unnecessary &nbsp; in date views pager.
+- Issue #2198807 by stickywes: Refactor field tests to utilize DateFieldBasic.
+- Issue #2146461 by vijaycs85 | Razia_b: Fixed Translated field's label is not used in its validation messages.
+- Issue #1874422 by bluetegu, brockfanning, rv0: Fixed Week pager may cause incorrect "next" link on year change.
+- Issue #2167015 by schifazl: HTML output breaks validation and accessibility.
+- Issue #2200513 by scor: Fix encoding issues in CHANGELOG.txt.
+- Issue #2115377 by coredumperror: Notice: Undefined index: add_microdata in theme_date_display_single().
+- Issue #2178299 by sandykadam | joachim: Incorrect variable name in hook_views_data_alter().
+- Issue #1431952 by Cadila | Shawn DeArmond: Date field will only set in Rules if it already has a value.
+- Issue #355058 by Grimreaper | prunelle: Hardcoded day/month/week output format for theme_date_nav_title().
+- Issue #1968828 by pjcdawkins: Replace field_info_fields() with field_info_field_map() for Drupal >= 7.22.
+- Issue #2167033 by podarok, vijaycs85: Fixing tests in 2014 .
 
 ======================
 Version 7.x-2.7
@@ -26,18 +48,18 @@ Version 7.x-2.7
 - Issue #1659466 by artkon: Fixed Date filter does not remember value in views if the identifier is something other than date_filter().
 - Issue #1905096 by gielfeldt: Fixed Wrong usage of database API.
 - Issue #1791804 by 5n00py: Errors on form validation if date field placed in sub-form.
-- Issue [#636208] Date range: Expose a single filter to select events that start before the chosen date and end after the chosen date by anrikun.
-- Issue [#2024269] Date popup documentation fix by RoySegall.
-- Issue [#1835184] by Steven Jones, das-peter, jwhat: Fixed date_limit_format() can have poor performance.
-- Issue [#991830] by milesw | restyler: Fixed validation errors when date_popup() date is localized.
-- Issue [#2098715] by jhodgdon: Fixed Date field not obeying widget alters for #required.
-- Issue [#1266688] by linclark, rbayliss, fago, colette: Support microdata in date fields.
-- Issue [#1863610] by maximpodorov: Fixed Invalid date formatting.
-- META [#2034231] [#1832544] Class registration for Migrate 2.5 or later - mikeryan, [#1835214] Automated tests failing - Exception thrown in Date2 migration - PatchRanger, [#
-- Issue [#1350604] by Alan D., johaziel: Added Diff support for Date fields.
-- Issue [#2086313] by dooug: Fixed Wrong path in date_popup() README.txt
-- Issue [#1455558] by BTMash | mediameriquat: Fixed Missing file in date_views().info causes error 500.
-- Issue [#1697322] by Alan D., ianmthomasuk | pandikamal: Fixed Call to a member function getName() on a non-object in date api.
+- Issue #636208 Date range: Expose a single filter to select events that start before the chosen date and end after the chosen date by anrikun.
+- Issue #2024269 Date popup documentation fix by RoySegall.
+- Issue #1835184 by Steven Jones, das-peter, jwhat: Fixed date_limit_format() can have poor performance.
+- Issue #991830 by milesw | restyler: Fixed validation errors when date_popup() date is localized.
+- Issue #2098715 by jhodgdon: Fixed Date field not obeying widget alters for #required.
+- Issue #1266688 by linclark, rbayliss, fago, colette: Support microdata in date fields.
+- Issue #1863610 by maximpodorov: Fixed Invalid date formatting.
+- META #2034231 #1832544 Class registration for Migrate 2.5 or later - mikeryan, [#1835214] Automated tests failing - Exception thrown in Date2 migration - PatchRanger, [#
+- Issue #1350604 by Alan D., johaziel: Added Diff support for Date fields.
+- Issue #2086313 by dooug: Fixed Wrong path in date_popup() README.txt
+- Issue #1455558 by BTMash | mediameriquat: Fixed Missing file in date_views().info causes error 500.
+- Issue #1697322 by Alan D., ianmthomasuk | pandikamal: Fixed Call to a member function getName() on a non-object in date api.
 - Code cleanup, remove #prev values that were never used in repeat functionality.
 - Small fix needed to ensure cardinality gets set correctly if repeat option is changed in the UI.
 
@@ -146,7 +168,7 @@ Version 7.x-2.1
 
 - Issue #1437242 by zerbash, Remove extraneous leading slashes in module_load_include().
 - Issue #1436722 by hefox: Fixed Undefined variable $form_set_error() used as function.
-- Issue #1250626 by G�bor Hojtsy, B-Prod, hefox: Added start date and end date labels.
+- Issue #1250626 by Gábor Hojtsy, B-Prod, hefox: Added start date and end date labels.
 - Issue #1253482, Make sure $argument->is_default gets reset by the Date pager when altering results.
 - Adjust Date Tools to work with changes to use Views templates to create calendars.
 - Issue #1398584 by dhalbert and , Make sure groupby times is initialized.
@@ -255,7 +277,7 @@ New Features/Major Changes
 Bugfixes
 
 - Fix to new default date handling, the default date has to set a date in the database timezone, not the display timezone.
-- Issue #1245106 by G�bor Hojtsy, Hide the option to add the delta into the view for single value fields.
+- Issue #1245106 by Gábor Hojtsy, Hide the option to add the delta into the view for single value fields.
 - Issue #1370876, Make sure new Date All Day code does not try to set the popup values if Date Popup is disabled.
 - Issue #874322, Add back the date_field_all_day() function to avoid breaking other modules that are using it.
 - Fix Date text placeholder to display a formatted date instead of a format. Follow up to Date repeat UI changes.
@@ -386,7 +408,7 @@ field settings. Previous versions did not always honor those settings, this one
 
 New Features/UX Improvements
 
-- Issue #1249724 by KarenS, G�bor Hojtsy, David_Rothstein, Improve usability of date and time input configuration.
+- Issue #1249724 by KarenS, Gábor Hojtsy, David_Rothstein, Improve usability of date and time input configuration.
 - Issue #1250784 by David_Rothstein, Add user-friendly labels for start and end date values in Views.
 - Issue #742146, Add option to remove X-WR-CALNAME if VEVENT is not a feed.
 - Add option to change method from PUBLISH to REQUEST in VCALENDAR.
@@ -396,8 +418,8 @@ New Features/UX Improvements
 - Issue #1249724 by David_Rothstein: Improve usability of date and time input configuration
 - Issue #1177198 by tim.plunkett: Allow CTools to process #dependency for date elements.
 - Issue #1245562 by David_Rothstein, Rename the default date display format to something friendlier
-- Issue #1239934 by David_Rothstein and G�bor Hojtsy, Reuse the "years back and forward" dropdown widget on the Views filter settings page.
-- Issue #1239228 by G�bor Hojtsy, Date Views filter form UI improvements, clarify the way absolute and relative dates work.
+- Issue #1239934 by David_Rothstein and Gábor Hojtsy, Reuse the "years back and forward" dropdown widget on the Views filter settings page.
+- Issue #1239228 by Gábor Hojtsy, Date Views filter form UI improvements, clarify the way absolute and relative dates work.
 - Issue #233047 by ksenzee and David_Rothstein, Add the Vegas jQuery timepicker as a new time selector option.
 - Issue #1145976 by tim.plunkett and KarenS, Add 'is date' identifier to all date handlers.
 - Issue #1234140 by arlinsundbulte, Change terminology in user-facing text from 'From/To Date' to 'Start/End Date'.
@@ -444,10 +466,10 @@ Bugfixes
 - Issue #1254582 Repeat additions need to be adjusted to use the same time as the original date.
 - Move vcalendar and vevent templates from Date Views to Date API modules.
 - Follow up to Issue #1250344, We don't need extra space when there is a description, only when there is not.
-- Issue #1239228 by G�bor Hojtsy, More tweaks to filter css.
-- Issue #1244924 by G�bor Hojtsy, Minor text improvements in date filter configuration
+- Issue #1239228 by Gábor Hojtsy, More tweaks to filter css.
+- Issue #1244924 by Gábor Hojtsy, Minor text improvements in date filter configuration
 - Issue #1245556 by David_Rothstein, Date granularity description incorrectly implies that it affects the date attributes that are displayed
-- Issue #1247444 by G�bor Hojtsy, Give a little breathing space to the date year range "other" field
+- Issue #1247444 by Gábor Hojtsy, Give a little breathing space to the date year range "other" field
 - Issue #1250344 by jessebeach, Fix padding around date fields by adding clearfix class.
 - Issue #1249116 by yched, Fix various glitches with D6 migration code.
 - Issue #1243022 by fmosca and KarenS, Make sure all_day #states visibility is only set when there is a value for all_day.
@@ -455,7 +477,7 @@ Bugfixes
 - Issue #1246416, Test whether libraries_get_path() returns a valid path before using it.
 - Issue #1235994, Don't display 'All Day' when using a format that has no time.
 - Issue #1245690 by mikeryan, Migration plugin missing seconds from date formats
-- Issue #1229406 by David Rothstein, G�bor Hojtsy, and tim.plunkett Fix broken timepicker in Chrome and Safari.
+- Issue #1229406 by David Rothstein, Gábor Hojtsy, and tim.plunkett Fix broken timepicker in Chrome and Safari.
 - Issue #1239412 by keithm, Fix validation error when #access is false.
 - Issue #1232522, Don't alter field_ui_field_edit form except on date fields.
 - Issue #1243842, Make sure the All Day and Show End Date flags work correctly in unlimited value fields that use ajax.
diff --git a/drupal7/sites/all/modules/date/date.info b/drupal7/sites/all/modules/date/date.info
index 242937c0..a1731de0 100644
--- a/drupal7/sites/all/modules/date/date.info
+++ b/drupal7/sites/all/modules/date/date.info
@@ -12,9 +12,9 @@ files[] = tests/date_migrate.test
 files[] = tests/date_validation.test
 files[] = tests/date_timezone.test
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date.module b/drupal7/sites/all/modules/date/date.module
index 6f4560b6..91c0b65a 100644
--- a/drupal7/sites/all/modules/date/date.module
+++ b/drupal7/sites/all/modules/date/date.module
@@ -536,6 +536,7 @@ function date_entity_metadata_property_info_alter(&$info, $entity_type, $field,
   if (!empty($field['settings']['todate'])) {
     // Define a simple data structure containing both dates.
     $property['type'] = ($field['cardinality'] != 1) ? 'list<struct>' : 'struct';
+    $property['auto creation'] = 'date_entity_metadata_struct_create';
     $property['getter callback'] = 'entity_metadata_field_verbatim_get';
     $property['setter callback'] = 'entity_metadata_field_verbatim_set';
     $property['property info'] = array(
@@ -645,6 +646,16 @@ function date_entity_metadata_field_setter(&$entity, $name, $value, $langcode, $
   drupal_static_reset('field_language');
 }
 
+/**
+ * Auto creation callback for fields which contain two date values in one
+ */
+function date_entity_metadata_struct_create($name, $property_info) {
+  return array(
+    'date_type' => $property_info['field']['columns'][$name]['type'],
+    'timezone_db' => $property_info['field']['settings']['timezone_db'],
+  );
+}
+
 /**
  * Callback for setting an individual field value if a to-date may be there too.
  * Based on entity_property_verbatim_set().
diff --git a/drupal7/sites/all/modules/date/date.theme b/drupal7/sites/all/modules/date/date.theme
index cc88e87c..a1f7d939 100644
--- a/drupal7/sites/all/modules/date/date.theme
+++ b/drupal7/sites/all/modules/date/date.theme
@@ -219,7 +219,7 @@ function theme_date_display_combination($variables) {
  * Template preprocess function for displaying a single date.
  */
 function template_preprocess_date_display_single(&$variables) {
-  if ($variables['add_rdf'] || $variables['add_microdata']) {
+  if ($variables['add_rdf'] || !empty($variables['add_microdata'])) {
     // Pass along the rdf mapping for this field, if any. Add some default rdf
     // attributes that will be used if not overridden by attributes passed in.
     $rdf_mapping = $variables['rdf_mapping'];
@@ -261,7 +261,7 @@ function theme_date_display_single($variables) {
   // Wrap the result with the attributes.
   $output = '<span class="date-display-single"' . drupal_attributes($attributes) . '>' . $date . $timezone . '</span>';
 
-  if ($variables['add_microdata']) {
+  if (!empty($variables['add_microdata'])) {
     $output .= '<meta' . drupal_attributes($variables['microdata']['value']['#attributes']) . '/>';
   }
 
@@ -372,7 +372,7 @@ function theme_date_combo($variables) {
 
   // Group start/end items together in fieldset.
   $fieldset = array(
-    '#title' => t($element['#title']) . ' ' . ($element['#delta'] > 0 ? intval($element['#delta'] + 1) : ''),
+    '#title' => field_filter_xss(t($element['#title'])) . ' ' . ($element['#delta'] > 0 ? intval($element['#delta'] + 1) : ''),
     '#value' => '',
     '#description' => !empty($element['#fieldset_description']) ? $element['#fieldset_description'] : '',
     '#attributes' => array(),
diff --git a/drupal7/sites/all/modules/date/date_all_day/date_all_day.info b/drupal7/sites/all/modules/date/date_all_day/date_all_day.info
index 14e1d864..8eeb7325 100644
--- a/drupal7/sites/all/modules/date/date_all_day/date_all_day.info
+++ b/drupal7/sites/all/modules/date/date_all_day/date_all_day.info
@@ -5,9 +5,9 @@ dependencies[] = date
 package = Date/Time
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_api/date_api.info b/drupal7/sites/all/modules/date/date_api/date_api.info
index 19ac12ce..3ca86e65 100644
--- a/drupal7/sites/all/modules/date/date_api/date_api.info
+++ b/drupal7/sites/all/modules/date/date_api/date_api.info
@@ -9,9 +9,9 @@ stylesheets[all][] = date.css
 files[] = date_api.module
 files[] = date_api_sql.inc
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_api/date_api.module b/drupal7/sites/all/modules/date/date_api/date_api.module
index 2ca0a333..b1be6e5f 100644
--- a/drupal7/sites/all/modules/date/date_api/date_api.module
+++ b/drupal7/sites/all/modules/date/date_api/date_api.module
@@ -459,7 +459,26 @@ class DateObject extends DateTime {
     if (!$true && $granularity) {
       foreach ((array) $granularity as $part) {
         if (!$this->hasGranularity($part) && in_array($part, array('second', 'minute', 'hour', 'day', 'month', 'year'))) {
-          $this->errors[$part] = t("The $part is missing.");
+          switch ($part) {
+            case 'second':
+              $this->errors[$part] = t('The second is missing.');
+              break;
+            case 'minute':
+              $this->errors[$part] = t('The minute is missing.');
+              break;
+            case 'hour':
+              $this->errors[$part] = t('The hour is missing.');
+              break;
+            case 'day':
+              $this->errors[$part] = t('The day is missing.');
+              break;
+            case 'month':
+              $this->errors[$part] = t('The month is missing.');
+              break;
+            case 'year':
+              $this->errors[$part] = t('The year is missing.');
+              break;
+          }
         }
       }
     }
@@ -1727,14 +1746,23 @@ function date_format_interval($date, $granularity = 2, $display_ago = TRUE) {
  *   The current time as a date object.
  */
 function date_now($timezone = NULL, $reset = FALSE) {
-  $now = &drupal_static(__FUNCTION__);
+  if ($reset) {
+    drupal_static_reset(__FUNCTION__ . $timezone);
+  }
+
+  $now = &drupal_static(__FUNCTION__ . $timezone);
 
-  if (!isset($now) || $reset) {
+  if (!isset($now)) {
     $now = new DateObject('now', $timezone);
   }
 
-  return $now;
+  // Avoid unexpected manipulation of cached $now object
+  // by subsequent code execution
+  // @see https://drupal.org/node/2261395
+  $clone = clone $now;
+  return $clone;
 }
+
 /**
  * Determines if a timezone string is valid.
  *
@@ -2357,26 +2385,38 @@ function date_get_timezone($handling, $timezone = '') {
 }
 
 /**
- * Function to figure out which db timezone applies to a date and select it.
+ * Function to figure out which db timezone applies to a date.
  *
  * @param string $handling
  *   The timezone handling.
  * @param string $timezone
- *   (optional) A timezone string. Defaults to an empty string.
+ *   (optional) When $handling is 'date', date_get_timezone_db() returns this
+ *   value.
  *
  * @return string
  *   The timezone string.
  */
-function date_get_timezone_db($handling, $timezone = '') {
+function date_get_timezone_db($handling, $timezone = NULL) {
   switch ($handling) {
-    case 'none':
-      $timezone = date_default_timezone();
+    case ('utc'):
+    case ('site'):
+    case ('user'):
+      // These handling modes all convert to UTC before storing in the DB.
+      $timezone = 'UTC';
+      break;
+    case ('date'):
+      if ($timezone == NULL) {
+        // This shouldn't happen, since it's meaning is undefined. But we need
+        // to fall back to *something* that's a legal timezone.
+        $timezone = date_default_timezone();
+      }
       break;
+    case ('none'):
     default:
-      $timezone = 'UTC';
+      $timezone = date_default_timezone();
       break;
   }
-  return $timezone > '' ? $timezone : 'UTC';
+  return $timezone;
 }
 
 /**
diff --git a/drupal7/sites/all/modules/date/date_context/date_context.info b/drupal7/sites/all/modules/date/date_context/date_context.info
index 5f4a0425..1d8a551d 100644
--- a/drupal7/sites/all/modules/date/date_context/date_context.info
+++ b/drupal7/sites/all/modules/date/date_context/date_context.info
@@ -8,9 +8,9 @@ dependencies[] = context
 
 files[] = date_context.module
 files[] = plugins/date_context_date_condition.inc
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_elements.inc b/drupal7/sites/all/modules/date/date_elements.inc
index 4303d132..6908d967 100644
--- a/drupal7/sites/all/modules/date/date_elements.inc
+++ b/drupal7/sites/all/modules/date/date_elements.inc
@@ -401,7 +401,7 @@ function date_combo_element_process($element, &$form_state, $form) {
     $element[$to_field]['#date_title'] = t('@field_name End date', array('@field_name' => $instance['label']));
   }
   else {
-    $element[$from_field]['#date_title'] = $instance['label'];
+    $element[$from_field]['#date_title'] = t('@field_name', array('@field_name' => $instance['label']));
   }
 
   $context = array(
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate.info b/drupal7/sites/all/modules/date/date_migrate/date_migrate.info
index 7cd23a4f..69012711 100644
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate.info
+++ b/drupal7/sites/all/modules/date/date_migrate/date_migrate.info
@@ -4,9 +4,9 @@ core = 7.x
 package = Date/Time
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info b/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info
index e5bbc8ac..7223b763 100644
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info
+++ b/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info
@@ -20,9 +20,9 @@ package = "Features"
 project = "date_migrate_example"
 version = "7.x-2.0"
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.install b/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.install
index 7a35cec9..d202bd05 100644
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.install
+++ b/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.install
@@ -12,3 +12,12 @@ function date_migrate_example_disable() {
   Migration::deregisterMigration('DateExample');
 }
 
+/**
+ * Implements hook_uninstall().
+ */
+function date_migrate_example_uninstall() {
+  node_type_delete('date_migrate_example');
+  variable_del('node_preview_date_migrate_example');
+  node_types_rebuild();
+  menu_rebuild();
+}
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc b/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
index fcc2a224..e11dea66 100644
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
+++ b/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
@@ -13,8 +13,8 @@ class DateExampleMigration extends XMLMigration {
   /**
    * Sets up the migration.
    */
-  public function __construct($arguments = array()) {
-    parent::__construct($arguments);
+  public function __construct() {
+    parent::__construct();
     $this->description = t('Example migration into date fields');
 
     $this->map = new MigrateSQLMap($this->machineName,
diff --git a/drupal7/sites/all/modules/date/date_popup/date_popup.info b/drupal7/sites/all/modules/date/date_popup/date_popup.info
index cdaf48e5..271e1c68 100644
--- a/drupal7/sites/all/modules/date/date_popup/date_popup.info
+++ b/drupal7/sites/all/modules/date/date_popup/date_popup.info
@@ -7,9 +7,9 @@ configure = admin/config/date/date_popup
 
 stylesheets[all][] = themes/datepicker.1.7.css
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_repeat/date_repeat.info b/drupal7/sites/all/modules/date/date_repeat/date_repeat.info
index d42bec9b..695a2fd9 100644
--- a/drupal7/sites/all/modules/date/date_repeat/date_repeat.info
+++ b/drupal7/sites/all/modules/date/date_repeat/date_repeat.info
@@ -7,9 +7,9 @@ php = 5.2
 files[] = tests/date_repeat.test
 files[] = tests/date_repeat_form.test
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_repeat/date_repeat_calc.inc b/drupal7/sites/all/modules/date/date_repeat/date_repeat_calc.inc
index 2a02d94b..4ff3c4a5 100644
--- a/drupal7/sites/all/modules/date/date_repeat/date_repeat_calc.inc
+++ b/drupal7/sites/all/modules/date/date_repeat/date_repeat_calc.inc
@@ -173,7 +173,7 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
       }
       if ($rrule['FREQ'] == 'YEARLY') {
         // Back up to first of year and jump.
-        $current_day = date_repeat_set_year_day($current_day, NULL, 1, '+', $timezone, $modify_time);
+        $current_day = date_repeat_set_year_day($current_day, NULL, NULL, 1, '+', $timezone, $modify_time);
         date_modify($current_day, '+' . $jump . $modify_time);
       }
       $finished = date_repeat_is_finished($current_day, $days, $count, $end_date);
@@ -223,18 +223,42 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
     $ordered = date_repeat_days_ordered($week_start_rule);
     $ordered_keys = array_flip($ordered);
 
-    foreach ($rrule['BYDAY'] as $day) {
-      preg_match("@(-)?([0-9]+)?([SU|MO|TU|WE|TH|FR|SA]{2})@", trim($day), $regs);
-      if (!empty($regs[2])) {
-        // Convert parameters into full day name, count, and direction.
-        $direction_days[] = array(
-          'day' => $day_names[$regs[3]],
-          'direction' => !empty($regs[1]) ? $regs[1] : '+',
-          'direction_count' => $regs[2],
-          );
+    if ($rrule['FREQ'] == 'YEARLY' && !empty($rrule['BYMONTH'])) {
+      // Additional cycle to apply month preferences.
+      foreach ($rrule['BYMONTH'] as $month) {
+        foreach ($rrule['BYDAY'] as $day) {
+          preg_match("@(-)?([0-9]+)?([SU|MO|TU|WE|TH|FR|SA]{2})@", trim($day), $regs);
+          // Convert parameters into full day name, count, and direction.
+          // Add leading zero to first 9 months.
+          if (!empty($regs[2])) {
+            $direction_days[] = array(
+              'day' => $day_names[$regs[3]],
+              'direction' => !empty($regs[1]) ? $regs[1] : '+',
+              'direction_count' => $regs[2],
+              'month' => strlen($month) > 1 ? $month : '0' . $month,
+            );
+          }
+          else {
+            $week_days[$ordered_keys[$regs[3]]] = $day_names[$regs[3]];
+          }
+        }
       }
-      else {
-        $week_days[$ordered_keys[$regs[3]]] = $day_names[$regs[3]];
+    }
+    else {
+      foreach ($rrule['BYDAY'] as $day) {
+        preg_match("@(-)?([0-9]+)?([SU|MO|TU|WE|TH|FR|SA]{2})@", trim($day), $regs);
+        if (!empty($regs[2])) {
+          // Convert parameters into full day name, count, and direction.
+          $direction_days[] = array(
+            'day' => $day_names[$regs[3]],
+            'direction' => !empty($regs[1]) ? $regs[1] : '+',
+            'direction_count' => $regs[2],
+            'month' => NULL,
+          );
+        }
+        else {
+          $week_days[$ordered_keys[$regs[3]]] = $day_names[$regs[3]];
+        }
       }
     }
     ksort($week_days);
@@ -251,7 +275,7 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
             $current_day = date_repeat_set_month_day($current_day, $day['day'], $day['direction_count'], $day['direction'], $timezone, $modify_time);
           }
           else {
-            $current_day = date_repeat_set_year_day($current_day, $day['day'], $day['direction_count'], $day['direction'], $timezone, $modify_time);
+            $current_day = date_repeat_set_year_day($current_day, $day['month'], $day['day'], $day['direction_count'], $day['direction'], $timezone, $modify_time);
           }
           date_repeat_add_dates($days, $current_day, $start_date, $end_date, $exceptions, $rrule);
         }
@@ -543,24 +567,42 @@ function date_repeat_set_month_day($date_in, $day, $count = 1, $direction = '+',
  *   If $day is empty, will set to the number of days from the
  *   beginning or end of the year.
  */
-function date_repeat_set_year_day($date_in, $day, $count = 1, $direction = '+', $timezone = 'UTC', $modify_time) {
+function date_repeat_set_year_day($date_in, $month, $day, $count = 1, $direction = '+', $timezone = 'UTC', $modify_time) {
   if (is_object($date_in)) {
     $current_year = date_format($date_in, 'Y');
 
     // Reset to the start of the month.
     // See note above.
     $datetime = date_format($date_in, DATE_FORMAT_DATETIME);
-    $datetime = substr_replace($datetime, '01-01', 5, 5);
+    $month_key = isset($month) ? $month : '01';
+    $datetime = substr_replace($datetime, $month_key . '-01', 5, 5);
     $date = new DateObject($datetime, $timezone);
-    if ($direction == '-') {
-      // For negative search, start from the end of the year.
-      date_modify($date, '+1 year' . $modify_time);
+
+    if (isset($month)) {
+      if ($direction == '-') {
+        // For negative search, start from the end of the month.
+        $modifier = '+1 month';
+      }
+      else {
+        // For positive search, back up one day to get outside the
+        // current month, so we can catch the first of the month.
+        $modifier = '-1 day';
+      }
     }
     else {
-      // For positive search, back up one day to get outside the
-      // current year, so we can catch the first of the year.
-      date_modify($date, '-1 day' . $modify_time);
+      if ($direction == '-') {
+        // For negative search, start from the end of the year.
+        $modifier = '+1 year';
+      }
+      else {
+        // For positive search, back up one day to get outside the
+        // current year, so we can catch the first of the year.
+        $modifier = '-1 day';
+      }
     }
+
+    date_modify($date, $modifier . $modify_time);
+
     if (empty($day)) {
       date_modify($date, $direction . $count . ' days' . $modify_time);
     }
diff --git a/drupal7/sites/all/modules/date/date_repeat/tests/date_repeat.test b/drupal7/sites/all/modules/date/date_repeat/tests/date_repeat.test
index fd46e810..fc4e5c3c 100644
--- a/drupal7/sites/all/modules/date/date_repeat/tests/date_repeat.test
+++ b/drupal7/sites/all/modules/date/date_repeat/tests/date_repeat.test
@@ -377,6 +377,19 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
+    //Every Last Thursday in November, every year, five times:
+    $start = "2014-11-27 00:00:00";
+    $rule = 'FREQ=YEARLY;INTERVAL=1;BYDAY=-1TH;BYMONTH=11;COUNT=5;WKST=SU';
+    //  ==> (2014 00:00 AM EDT)November 27
+    //      (2015 00:00 AM EDT)November 26
+    //      (2016 00:00 AM EDT)November 24
+    //      (2017 00:00 AM EDT)November 30
+    //      (2018 00:00 AM EDT)November 29
+    $dates = date_repeat_calc($rule, $start, NULL, array());
+    $shouldbe = '2014-11-27 00:00:00, 2015-11-26 00:00:00, 2016-11-24 00:00:00, 2017-11-30 00:00:00, 2018-11-29 00:00:00';
+    $result = implode(', ', $dates);
+    $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
+
 return;
 
     //Every Thanksgiving, forever:
diff --git a/drupal7/sites/all/modules/date/date_repeat/tests/date_repeat_form.test b/drupal7/sites/all/modules/date/date_repeat/tests/date_repeat_form.test
index d514739d..0c5460ba 100644
--- a/drupal7/sites/all/modules/date/date_repeat/tests/date_repeat_form.test
+++ b/drupal7/sites/all/modules/date/date_repeat/tests/date_repeat_form.test
@@ -195,20 +195,22 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
     $edit = array();
     $edit['title'] = $this->randomName(8);
     $edit['body[und][0][value]'] = $this->randomName(16);
+    $current_year = date('Y');
+
 
     switch ($options) {
       case 'select':
-        $edit['field_test[und][0][value][year]'] = '2010';
+        $edit['field_test[und][0][value][year]'] = $current_year;
         $edit['field_test[und][0][value][month]'] = '10';
         $edit['field_test[und][0][value][day]'] = '7';
         $edit['field_test[und][0][value][hour]'] = '10';
         $edit['field_test[und][0][value][minute]'] = '30';
         break;
       case 'text':
-        $edit['field_test[und][0][value][date]'] = '2010-10-07 10:30';
+        $edit['field_test[und][0][value][date]'] = format_string('!year-10-07 10:30', array('!year' => $current_year));
         break;
       case 'popup':
-        $edit['field_test[und][0][value][date]'] = '2010-10-07';
+        $edit['field_test[und][0][value][date]'] = format_string('!year-10-07', array('!year' => $current_year));
         $edit['field_test[und][0][value][time]'] = '10:30';
         break;
     }
@@ -378,7 +380,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
       else {
         $edit['field_test[und][0][rrule][range_of_repeat]'] = 'UNTIL';
         $date = array(
-          'year' => '2011',
+          'year' => $current_year + 1,
           'month' => '10',
           'day' => '07'
         );
@@ -392,7 +394,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           case 'exclude':
             $exclude_include_edit['field_test[und][0][rrule][show_exceptions]'] = TRUE;
             $date = array(
-              'year' => '2010',
+              'year' => $current_year,
               'month' => '10',
               'day' => '07'
             );
@@ -401,7 +403,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           case 'include':
             $exclude_include_edit['field_test[und][0][rrule][show_additions]'] = TRUE;
             $date = array(
-              'year' => '2013',
+              'year' => $current_year + 3,
               'month' => '10',
               'day' => '07'
             );
@@ -410,7 +412,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           case 'exclude_include':
             $exclude_include_edit['field_test[und][0][rrule][show_exceptions]'] = TRUE;
             $date = array(
-              'year' => '2010',
+              'year' => $current_year,
               'month' => '10',
               'day' => '07'
             );
@@ -418,7 +420,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
 
             $exclude_include_edit['field_test[und][0][rrule][show_additions]'] = TRUE;
             $date = array(
-              'year' => '2013',
+              'year' => $current_year + 3,
               'month' => '10',
               'day' => '07'
             );
@@ -510,7 +512,6 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
         break;
       case 'text':
       case 'popup':
-        //$return["{$field_name}[datetime][date]"] = '2011-10-07';
         $return["{$form_field_name}[datetime][date]"] = "{$date['year']}-{$date['month']}-{$date['day']}";
         break;
     }
diff --git a/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.info b/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.info
index 90d556c7..20e95df8 100644
--- a/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.info
+++ b/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.info
@@ -7,9 +7,9 @@ stylesheets[all][] = date_repeat_field.css
 package = Date/Time
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.module b/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.module
index c04e13ec..9e5c8c12 100644
--- a/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.module
+++ b/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.module
@@ -115,16 +115,38 @@ function date_repeat_field_permission() {
 }
 
 /**
- * See if the user can access repeat date info for this field.
+ * See if the user can access repeat date info for this entity.
+ *
+ * @param string $entity_type
+ *   The entity type.
+ * @param string $entity
+ *   The specific entity to check (optional).
+ *
+ * @return bool
+ *   Return TRUE if there is at least one date field attached to this entity,
+ *   and the current user has the permission 'view date repeats'; FALSE otherwise.
  */
 function date_repeat_field_show($entity_type = 'node', $entity = NULL) {
+  if (!user_access('view date repeats')) {
+    return FALSE;
+  }
+
   $bundle = date_get_entity_bundle($entity_type, $entity);
-  foreach (field_info_fields() as $field_name => $field) {
-    if (in_array($field['type'], array('date', 'datestamp', 'datetime'))
-        && array_key_exists($entity_type, $field['bundles'])
-        && in_array($bundle, $field['bundles'][$entity_type])
-        && date_is_repeat_field($field)) {
-      return user_access('view date repeats');
+
+  // In Drupal 7.22 the field_info_field_map() function was added, which is more
+  // memory-efficient in certain cases than field_info_fields().
+  // @see https://drupal.org/node/1915646
+  $field_map_available = version_compare(VERSION, '7.22', '>=');
+  $field_list = $field_map_available ? field_info_field_map() : field_info_fields();
+
+  foreach ($field_list as $field_name => $data) {
+    if (in_array($data['type'], array('date', 'datestamp', 'datetime'))
+        && array_key_exists($entity_type, $data['bundles'])
+        && in_array($bundle, $data['bundles'][$entity_type])) {
+      $field_info = $field_map_available ? field_info_field($field_name) : $data;
+      if (date_is_repeat_field($field_info)) {
+        return TRUE;
+      }
     }
   }
   return FALSE;
diff --git a/drupal7/sites/all/modules/date/date_tools/date_tools.info b/drupal7/sites/all/modules/date/date_tools/date_tools.info
index 51b8691b..dbcff7d9 100644
--- a/drupal7/sites/all/modules/date/date_tools/date_tools.info
+++ b/drupal7/sites/all/modules/date/date_tools/date_tools.info
@@ -6,9 +6,9 @@ core = 7.x
 configure = admin/config/date/tools
 files[] = tests/date_tools.test
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_views/date_views.info b/drupal7/sites/all/modules/date/date_views/date_views.info
index 4abeb604..0f2d7ec3 100644
--- a/drupal7/sites/all/modules/date/date_views/date_views.info
+++ b/drupal7/sites/all/modules/date/date_views/date_views.info
@@ -12,9 +12,9 @@ files[] = includes/date_views_filter_handler_simple.inc
 files[] = includes/date_views.views.inc
 files[] = includes/date_views_plugin_pager.inc
 
-; Information added by Drupal.org packaging script on 2013-12-21
-version = "7.x-2.7"
+; Information added by Drupal.org packaging script on 2014-07-29
+version = "7.x-2.8"
 core = "7.x"
 project = "date"
-datestamp = "1387659206"
+datestamp = "1406653438"
 
diff --git a/drupal7/sites/all/modules/date/date_views/date_views.install b/drupal7/sites/all/modules/date/date_views/date_views.install
new file mode 100644
index 00000000..c9697b2d
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_views/date_views.install
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions for the Date Views module.
+ */
+
+/**
+ * Implements hook_install().
+ */
+function date_views_install() {
+  variable_set('date_views_month_format_with_year', 'F Y');
+  variable_set('date_views_month_format_without_year', 'F');
+  variable_set('date_views_day_format_with_year', 'l, F j, Y');
+  variable_set('date_views_day_format_without_year', 'l, F j');
+  variable_set('date_views_week_format_with_year', 'F j, Y');
+  variable_set('date_views_week_format_without_year', 'F j');
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function date_views_uninstall() {
+  variable_del('date_views_month_format_with_year');
+  variable_del('date_views_month_format_without_year');
+  variable_del('date_views_day_format_with_year');
+  variable_del('date_views_day_format_without_year');
+  variable_del('date_views_week_format_with_year');
+  variable_del('date_views_week_format_without_year');
+}
diff --git a/drupal7/sites/all/modules/date/date_views/date_views.module b/drupal7/sites/all/modules/date/date_views/date_views.module
index 03a80dd4..04bad091 100644
--- a/drupal7/sites/all/modules/date/date_views/date_views.module
+++ b/drupal7/sites/all/modules/date/date_views/date_views.module
@@ -1,5 +1,80 @@
 <?php
 
+
+/**
+ * Implements hook_menu().
+ */
+function date_views_menu() {
+  // Used to import files from a local filesystem into Drupal.
+  $items['admin/config/regional/date-time/date-views'] = array(
+    'title' => 'Date views',
+    'description' => 'Configure settings for date views.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('date_views_settings'),
+    'access arguments' => array('administer site configuration '),
+    'type' => MENU_LOCAL_TASK,
+  );
+
+  return $items;
+}
+
+/**
+ * Form callback for date views settings.
+ */
+function date_views_settings($form, &$form_state) {
+
+  $form['date_views_month_format_with_year'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Date views month format with year'),
+    '#size' => 10,
+    '#default_value' => variable_get('date_views_month_format_with_year', 'F Y'),
+    '#description' => t('Date views month format with year, default value : F Y'),
+  );
+
+  $form['date_views_month_format_without_year'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Date views month format without year'),
+    '#size' => 10,
+    '#default_value' => variable_get('date_views_month_format_without_year', 'F'),
+    '#description' => t('Date views month format without year, default value : F'),
+  );
+
+  $form['date_views_day_format_with_year'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Date views day format with year'),
+    '#size' => 10,
+    '#default_value' => variable_get('date_views_day_format_with_year', 'l, F j, Y'),
+    '#description' => t('Date views day format with year, default value : l, F j, Y'),
+  );
+
+  $form['date_views_day_format_without_year'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Date views day format without year'),
+    '#size' => 10,
+    '#default_value' => variable_get('date_views_day_format_without_year', 'l, F j'),
+    '#description' => t('Date views day format without year, default value : l, F j'),
+  );
+
+  $form['date_views_week_format_with_year'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Date views week format with year'),
+    '#size' => 10,
+    '#default_value' => variable_get('date_views_week_format_with_year', 'F j, Y'),
+    '#description' => t('Date views week format with year, default value : F j, Y'),
+  );
+
+  $form['date_views_week_format_without_year'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Date views week format without year'),
+    '#size' => 10,
+    '#default_value' => variable_get('date_views_week_format_without_year', 'F j'),
+    '#description' => t('Date views week format without year, default value : F j'),
+  );
+
+  return system_settings_form($form);
+
+}
+
 /**
  * Implements hook_views_api().
  *
diff --git a/drupal7/sites/all/modules/date/date_views/includes/date_views.views.inc b/drupal7/sites/all/modules/date/date_views/includes/date_views.views.inc
index 9ee9e6d1..b236d2e0 100644
--- a/drupal7/sites/all/modules/date/date_views/includes/date_views.views.inc
+++ b/drupal7/sites/all/modules/date/date_views/includes/date_views.views.inc
@@ -128,7 +128,7 @@ function date_views_views_data_alter(&$data) {
   // Mark all the core date handlers as date fields.
   // This will identify all handlers that directly use the _date handlers,
   // will not pick up any that extend those handlers.
-  foreach ($data as $module => &$table) {
+  foreach ($data as $base_table => &$table) {
     foreach ($table as $id => &$field) {
       foreach (array('field', 'sort', 'filter', 'argument') as $type) {
         if (isset($field[$type]) && isset($field[$type]['handler']) && ($field[$type]['handler'] == 'views_handler_' . $type . '_date')) {
diff --git a/drupal7/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc b/drupal7/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
index 2d3fb7cf..35f88e00 100644
--- a/drupal7/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
+++ b/drupal7/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
@@ -64,7 +64,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
       if ($granularity == 'week') {
         $now = date_now();
         $week = date_week(date_format($now, 'Y-m-d'));
-        $value = date_format($now, 'Y') . '-W' . $week;
+        $value = date_format($now, 'o') . '-W' . date_pad($week);
       }
       else {
         $value = date($this->arg_format, REQUEST_TIME);
diff --git a/drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc b/drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
index b84eac3c..d41f30b6 100644
--- a/drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
+++ b/drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
@@ -371,7 +371,7 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
         '#date_label_position' => 'within',
         '#date_year_range' => $this->options['year_range'],
         '#process' => array($type . '_element_process'),
-        '#prefix' => '<div id="' . $id . '-wrapper"><div id="' . $id . '">',
+        '#prefix' => '<div id="' . $id . '-wrapper"><div id="' . $id . '-inside-wrapper">',
         '#suffix' => '</div></div>',
       );
       if ($which == 'all') {
@@ -406,7 +406,7 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
         '#date_label_position' => 'within',
         '#date_year_range' => $this->options['year_range'],
         '#process' => array($type . '_element_process'),
-        '#prefix' => '<div id="' . $id . '-wrapper"><div id="' . $id . '">',
+        '#prefix' => '<div id="' . $id . '-wrapper"><div id="' . $id . '-inside-wrapper">',
         '#suffix' => '</div></div>',
         '#states' => array(
           'visible' => array(
diff --git a/drupal7/sites/all/modules/date/date_views/theme/date-views-pager.tpl.php b/drupal7/sites/all/modules/date/date_views/theme/date-views-pager.tpl.php
index 531214cb..b12c2e1c 100644
--- a/drupal7/sites/all/modules/date/date_views/theme/date-views-pager.tpl.php
+++ b/drupal7/sites/all/modules/date/date_views/theme/date-views-pager.tpl.php
@@ -37,10 +37,10 @@
     <?php if (!empty($prev_url)) : ?>
       <li class="date-prev">
         <?php print l('&laquo;' . ($mini ? '' : ' ' . t('Prev', array(), array('context' => 'date_nav'))), $prev_url, $prev_options); ?>
-      &nbsp;</li>
+      </li>
     <?php endif; ?>
     <?php if (!empty($next_url)) : ?>
-      <li class="date-next">&nbsp;
+      <li class="date-next">
         <?php print l(($mini ? '' : t('Next', array(), array('context' => 'date_nav')) . ' ') . '&raquo;', $next_url, $next_options); ?>
       </li>
     <?php endif; ?>
diff --git a/drupal7/sites/all/modules/date/date_views/theme/theme.inc b/drupal7/sites/all/modules/date/date_views/theme/theme.inc
index 4a7d4bc5..8c42a527 100644
--- a/drupal7/sites/all/modules/date/date_views/theme/theme.inc
+++ b/drupal7/sites/all/modules/date/date_views/theme/theme.inc
@@ -75,8 +75,8 @@ function template_preprocess_date_views_pager(&$vars) {
       case 'week':
         $next_week = date_week(date_format($next_date, 'Y-m-d'));
         $prev_week = date_week(date_format($prev_date, 'Y-m-d'));
-        $next_arg = date_format($next_date, 'Y-\W') . date_pad($next_week);
-        $prev_arg = date_format($prev_date, 'Y-\W') . date_pad($prev_week);
+        $next_arg = date_format($next_date, 'o-\W') . date_pad($next_week);
+        $prev_arg = date_format($prev_date, 'o-\W') . date_pad($prev_week);
         break;
       default:
         $next_arg = date_format($next_date, $format[$granularity]);
@@ -165,23 +165,25 @@ function theme_date_nav_title($params) {
   $date_info = $view->date_info;
   $link = !empty($params['link']) ? $params['link'] : FALSE;
   $format = !empty($params['format']) ? $params['format'] : NULL;
+  $format_with_year = variable_get('date_views_' . $granularity . 'format_with_year', 'l, F j, Y');
+  $format_without_year = variable_get('date_views_' . $granularity . 'format_without_year', 'l, F j');
   switch ($granularity) {
     case 'year':
       $title = $date_info->year;
       $date_arg = $date_info->year;
       break;
     case 'month':
-      $format = !empty($format) ? $format : (empty($date_info->mini) ? 'F Y' : 'F');
+      $format = !empty($format) ? $format : (empty($date_info->mini) ? $format_with_year : $format_without_year);
       $title = date_format_date($date_info->min_date, 'custom', $format);
       $date_arg = $date_info->year . '-' . date_pad($date_info->month);
       break;
     case 'day':
-      $format = !empty($format) ? $format : (empty($date_info->mini) ? 'l, F j, Y' : 'l, F j');
+      $format = !empty($format) ? $format : (empty($date_info->mini) ? $format_with_year : $format_without_year);
       $title = date_format_date($date_info->min_date, 'custom', $format);
       $date_arg = $date_info->year . '-' . date_pad($date_info->month) . '-' . date_pad($date_info->day);
       break;
     case 'week':
-      $format = !empty($format) ? $format : (empty($date_info->mini) ? 'F j, Y' : 'F j');
+      $format = !empty($format) ? $format : (empty($date_info->mini) ? $format_with_year : $format_without_year);
       $title = t('Week of @date', array('@date' => date_format_date($date_info->min_date, 'custom', $format)));
       $date_arg = $date_info->year . '-W' . date_pad($date_info->week);
       break;
diff --git a/drupal7/sites/all/modules/date/tests/date.test b/drupal7/sites/all/modules/date/tests/date.test
index 3b8f35eb..04b06447 100644
--- a/drupal7/sites/all/modules/date/tests/date.test
+++ b/drupal7/sites/all/modules/date/tests/date.test
@@ -5,8 +5,7 @@
  * Test date UI.
  */
 
-class DateUITestCase extends DrupalWebTestCase {
-  protected $privileged_user;
+class DateUITestCase extends DateFieldBasic {
 
   /**
    * @todo.
@@ -23,14 +22,7 @@ class DateUITestCase extends DrupalWebTestCase {
    * @todo.
    */
   public function setUp() {
-    // Load the date_api module.
-    parent::setUp('field', 'field_ui', 'date_api', 'date', 'date_popup', 'date_tools');
-
-    // Create and log in our privileged user.
-    $this->privileged_user = $this->drupalCreateUser(
-      array('administer content types', 'administer nodes', 'bypass node access', 'administer date tools')
-    );
-    $this->drupalLogin($this->privileged_user);
+    parent::setUp();
 
     variable_set('date_format_long', 'D, m/d/Y - H:i');
   }
@@ -39,82 +31,34 @@ class DateUITestCase extends DrupalWebTestCase {
    * @todo.
    */
   public function testFieldUI() {
-    $edit = array();
-    $edit['name'] = 'Story';
-    $edit['type'] = 'story';
-    $this->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
-    $this->assertText('The content type Story has been added.', 'Content type added.');
+    $label = 'Test';
+    $current_year = date('Y');
 
-    // Creates select list field stored as a date with default settings.
-    $this->createDateField($type = 'date', $widget = 'date_select');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'select');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a date field using the date_select widget.');
-    $this->deleteDateField();
-    // Creates text field stored as a date with default settings.
-    $this->createDateField($type = 'date', $widget = 'date_text');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'text');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a date field using the date_text widget.');
-    $this->deleteDateField();
-    // Creates popup field stored as a date with default settings.
-    $this->createDateField($type = 'date', $widget = 'date_popup');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'popup');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a date field using the date_popup widget.');
-    $this->deleteDateField();
-    // Creates select list field stored as a datestamp with default settings.
-    $this->createDateField($type = 'datestamp', $widget = 'date_select');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'select');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a datestamp field using the date_select widget.');
-    $this->deleteDateField();
-    // Creates text field stored as a datestamp with default settings.
-    $this->createDateField($type = 'datestamp', $widget = 'date_text');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'text');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a datestamp field using the date_text widget.');
-    $this->deleteDateField();
-    // Creates popup field stored as a datestamp with default settings.
-    $this->createDateField($type = 'datestamp', $widget = 'date_popup');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'popup');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a datestamp field using the date_popup widget.');
-    $this->deleteDateField();
-    // Creates select list field stored as a datetime with default settings.
-    $this->createDateField($type = 'datetime', $widget = 'date_select');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'select');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a datetime field using the date_select widget.');
-    $this->deleteDateField();
-    // Creates text field stored as a datetime with default settings.
-    $this->createDateField($type = 'datetime', $widget = 'date_text');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'text');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a datetime field using the date_text widget.');
-    $this->deleteDateField();
-    // Creates popup field stored as a datetime with default settings.
-    $this->createDateField($type = 'datetime', $widget = 'date_popup');
-    $edit = array();
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
-    $this->dateForm($options = 'popup');
-    $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for a datetime field using the date_popup widget.');
-    $this->deleteDateField();
+    $field_types = array('date', 'datestamp', 'datetime');
+    $widget_types = array('date_select', 'date_text', 'date_popup');
+
+    // Test widgets with default settings using every widget and field type.
+    foreach ($field_types as $field_type) {
+      foreach ($widget_types as $widget_type) {
+        $this->createDateField(
+            array(
+              'label' => $label,
+              'field_type' => $field_type,
+              'widget_type' => $widget_type,
+            )
+        );
+        $this->dateForm($widget_type);
+        $this->assertText(format_string('10/07/!year - 10:30', array('!year' => $current_year)), 'Found the correct date for a date field using the ' . $widget_type . ' widget.');
+        $this->deleteDateField($label);
+      }
+    }
 
     // Test timezone handling validation on the field settings form.
-    $this->createDateField($type = 'date', $widget = 'date_select');
+    $this->createDateField(array('label' => $label, 'field_type' => 'date', 'widget_type' => 'date_select', 'granularity' => array('year', 'month', 'day')));
     $edit = array('field[settings][granularity][hour]' => FALSE);
-    $this->drupalPost(NULL, $edit, t('Save field settings'));
+    $this->drupalPost('admin/structure/types/manage/story/fields/field_' . strtolower($label), $edit, t('Save settings'));
     $this->assertText("Dates without hours granularity must not use any timezone handling.", "Dates without hours granularity required to use timezone handling of 'none.'");
-    $this->deleteDateField();
+    $this->deleteDateField($label);
   }
 
   /**
@@ -125,44 +69,23 @@ class DateUITestCase extends DrupalWebTestCase {
     $edit = array();
     $edit['title'] = $this->randomName(8);
     $edit['body[und][0][value]'] = $this->randomName(16);
-    if ($options == 'select') {
-      $edit['field_test[und][0][value][year]'] = '2010';
+    $current_year = date('Y');
+
+    if ($options == 'date_select') {
+      $edit['field_test[und][0][value][year]'] = $current_year;
       $edit['field_test[und][0][value][month]'] = '10';
       $edit['field_test[und][0][value][day]'] = '7';
       $edit['field_test[und][0][value][hour]'] = '10';
       $edit['field_test[und][0][value][minute]'] = '30';
     }
-    elseif ($options == 'text') {
-      $edit['field_test[und][0][value][date]'] = '10/07/2010 - 10:30';
+    elseif ($options == 'date_text') {
+      $edit['field_test[und][0][value][date]'] = format_string('10/07/!year - 10:30', array('!year' => $current_year));
     }
-    elseif ($options == 'popup') {
-      $edit['field_test[und][0][value][date]'] = '10/07/2010';
+    elseif ($options == 'date_popup') {
+      $edit['field_test[und][0][value][date]'] = format_string('10/07/!year', array('!year' => $current_year));
       $edit['field_test[und][0][value][time]'] = '10:30';
     }
     $this->drupalPost('node/add/story', $edit, t('Save'));
     $this->assertText($edit['body[und][0][value]'], 'Test node has been created');
   }
-
-  /**
-   * @todo.
-   */
-  function createDateField($type, $widget) {
-    $edit = array();
-    $edit['fields[_add_new_field][label]'] = 'Test';
-    $edit['fields[_add_new_field][field_name]'] = 'test';
-    $edit['fields[_add_new_field][weight]'] = '-4';
-    $edit['fields[_add_new_field][type]'] = $type;
-    $edit['fields[_add_new_field][widget_type]'] = $widget;
-    $this->drupalPost('admin/structure/types/manage/story/fields', $edit, t('Save'));
-  }
-
-  /**
-   * @todo.
-   */
-  function deleteDateField() {
-    $this->drupalGet('admin/structure/types/manage/story/fields');
-    $this->clickLink('delete');
-    $this->drupalPost(NULL, NULL, t('Delete'));
-    $this->assertText('The field Test has been deleted from the Story content type.', 'Removed date field.');
-  }
 }
