commit 599a39cdec4ceb30754ede873cda4c36703e9ce4
Author: Assos Assos <assos+forge@centrale-marseille.fr>
Date:   Wed Mar 10 23:28:35 2021 +0100

    Weekly update of contrib modules

diff --git a/drupal7/sites/all/modules/date/CHANGELOG.txt b/drupal7/sites/all/modules/date/CHANGELOG.txt
index e5e655e2..dbdcb43c 100644
--- a/drupal7/sites/all/modules/date/CHANGELOG.txt
+++ b/drupal7/sites/all/modules/date/CHANGELOG.txt
@@ -1,674 +1,1282 @@
-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
-======================
-- Issue #1691342 by Cyberwolf: Field description is displayed multiple times.
-- Issue #1668240 by ianthomas_uk: /themes/jquery.timeentry.css is not aggregated with other CSS files.
-- Issue #1974056 by pjcdawkins: Add a CSS class to the date repeat rule.
-- Issue #2065749 by vijaycs85, blackdog: $class in theme_date_repeat_rrule is not used.
-- Issue #1840008 by cr0ss, Alan D.: Unlock "Date attributes" (granularity) field setting.
-- Issue #1580032 by jmuzz | 30equals: Date values are not being saved when field is used in a nested field collection.
-- Issue #2071629 by blackdog: #after_build wrongly added, overwrites other modules.
-- Issue #1869962 by kaidjohnson: Date Context breaks context edit form.
-- Issue #1571258 by David_Rothstein | ddalvi: Date and time form elements do not have accessible labels when the label position is set to 'Within' or 'None'.
-- Issue #2130575 by kostajh: Unset() should be used with more caution in views_filter_handler_simple().inc.
-- Issue #1826598 by eromba, jyee: 'c' and 'r' formatter causes date to be printed twice in views.
-- Issue #1933472 by minorOffense: Added Optimize date_now() function.
-- Issue #1248786 by kenneth.venken | dboulet: Fixed appearance of marker for required date fields.
-- Issue #1810734 by ParisLiakos: Fixed Repeat checkboxes working reversed with updated jQuery.
-- Issue #1844092 by dboulet, kardave, Spleshka: Fixed Untranslated strings: month, day, ...
-- Issue #1202248 by james.williams, dawehner, mikehues | DamienMcKenna: Fixed Exported view doesn't include 'default_argument_options()' attribute.
-- Issue #1409120 by anrikun, akamustang | marsbidon: Added Date format in views exposed filter does not respect configured format.
-- Issue #1858112 by tomdearden: Fixed DateObject->difference not calculating correctly for future dates > 1 year away.
-- 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.
-- 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.
-
-======================
-Version 7.x-2.6
-======================
-
-- Issue #1423364 by catmat, Add file and path to hook_context_plugins().
-- Issue #1713248, Remove incorrect use of date_popup() function in previous commit.
-- Issue #1143680 by kristiaanvandeneynde, Make Date Popup widget able to accept custom settings.
-- Issue #1596546 by applicity_sam, Make sure incorrect month name creates validation error.
-- Issue #1432702, Fix some miscellaneous problems with date example dates and formats.
-- Issue #1512464 by Liam Moreland, Allow for undefined formatter in Date upgrade handling.
-- Issue #1659638 by bojanz, Hide install message if Drupal is not installed (i.e. in install profiles).
-- Issue #1605158 by covenantd, Be sure value2 is initiated in Date Context handler.
-- Issue #1355256 by barraponto develCuy and KarenS, set default value for date text widget increment to 1, and update existing fields.
-- Issue #1561306 by Cyberwolf, Date pager replacement was not working correctly when used with multiple dates.
-- Issue #1541740 by hass, Make Date requirements more easily translatable.
-- Issue #1543524 by iamEAP, Add update hook to remove the D6 date_timezone field from users.
-- Issue #1603640 by bevan, Don't return anything for empty date interval.
-- Issue #1235508, Make sure that ISO strings with '00' in the month and/or day don't create dates for the previous month and day.
-- Issue #1289270 by pdrake: Fixed date arguments and filters do not work with relationships.
-- Issue #895760 by Reinette: Added RFC2447 option 'STATUS' to date_api_ical().inc.
-- Issue #606658 by johnmunro and KarenS, Make sure ical import processes multi-day all-day events correctly.
-- Issue #1408216 follow up, Need to be sure that NULL is the default state for the sql functions.
-- Issue #1540410, Update the Date Tools calendar creation wizard to use the new calendar path.
-
-======================
-Version 7.x-2.5
-======================
-
-- Fix nasty errors on views that have no row indexes, like the frontage view.
-
-======================
-Version 7.x-2.4
-======================
-
-- Issue #1534342 by bass, Make name of clean pager option easier to translate.
-- Add a hook to alter the default date for a Date argument.
-- Issue #1531904, Make sure that multiple value dates that have the delta set only display the selected value.
-- Revert Issue #1266688 by fago, This change broke Entity token support.
-
-======================
-Version 7.x-2.3
-======================
-
-- Issue #1444804, Remove html placeholder on text widget.
-- Issue #1286230, Clean up date pager documentation, it contains deprecated information.
-- Issue #1469020, Make sure page not found is working right for dates outside the specified range.
-- Issue #1111626, Fix some problems caused by passing in a date string with an offset.
-- Issue #1477860, Avoid undefined index errors in date_views_select_validate().
-- Issue #1469038, Add some clarity to the BYDAY description options and make sure a valid value is selected.
-- Issue #1405364 by snufkin, Add display options to format_interval to match Views interval options.
-- Issue #1266688 by linclark, Add microdata support to Date metadata.
-- Issue #1509434 by casey, Add timezone info in hook_field_presave() instead of hook_field_insert() and hook_field_update().
-- Issue #1509012, Fix fatal error when viewing repeat tab.
-- Issue #1037174 by dealancer, More work to allow ajax to work on other widgets.
-- Issue #1473592 by zabelc, Make sure migrated date with missing end date still gets imported correctly.
-- Issue #1442718 by jastraat and bones, Make sure show end date checkbox does not display when end date is empty.
-- Issue #1504556, Fix invalid access permission name in Date API configuration menu.
-- Issue #1484458, Vega timepicker code was incorrectly computing the default date because of the wrong format for the value passed to it.
-- Issue #1459668, Add back Remove date_field_get_sql_handler() function temporarily since Signup module is still using it. Mark it deprecated.
-- Issue #1478296, Display longer abbreviations for day names in date repeat widget so they can be translated.
-- Issue #1488662 by martin.heidegger, Make error message more easily translatable.
-- Issue #1478848 by onelittleant, Don't set default values on new translation entities.
-- Issue #1360672, Fix limit format code to remove leftover non-ascii text as well as leftover ascii text.
-- Issue #1464280 by geerlingguy Georgique and dealancer: Fix notice when using exposed between filter.
-- Issue #1484640 by onelittleant, Some entities may not have base tables.
-- Issue #1472966, Get rid of notice that appears for entities without repeats.
-- Move pager css around. Some code in Calendar and Date API belongs in Date Views.
-- Fix Date Popup default format which was ending up using 24 hour time no matter what format was used for short format.
-- Remove outdated _repeat widget name from Date Tools.
-- Date Tools is defaulting to creating a calendar even if Calendar module is not enabled.
-- Issue #1472148 by arlinsandbulte: wvega jQuery time-picker doesn't show scrollbar.
-- Issue #1392128 by kidrobot, tim.plunkett, willvincent: Fixed Repeats tab shows on nodes with non-repeating dates.
-- Issue #1452882 by coredumperror: Fixed Date Migrate Example doesn't deregister it's migration when disabled.
-- Issue #1452408 by reglogge: Fixed Trailing dots are removed from date formats even if they are needed for the format.
-- Issue #1285260 by Steven Jones: Fixed 'Starting from' display option.
-- Issue #1467244 by bluetegu: Fixed Recurring Sunday errors.
-- Issue #1442718, Empty default values were getting populated by the code that tried to fix default values on hidden fields.
-- Make sure date_handler->placeholders gets initialized even for queries that don't execute so the pager won't throw an exception if the value is missing.
-
-======================
-Version 7.x-2.2
-======================
-
-NOTES:
-The iCal templates were removed and moved to the new Date iCal module (http://drupal.org/project/date_ical).
-
-- Issue #1423364 by emptyvoid, Move Date context plugin into its own file.
-- Issue #1447372 by yched, Memory friendlier version of date_repeat_field_bundles().
-- Issue #1447140 by tim.plunkett: Remove iCal-related theme functions/files.
-- Issue #1284170 by benjifisher, Lots of cleanup of the iCal export and its template to be sure all day items are exported correctly.
-- Issue #1346424, The calendar title got left out of the latest ical template changes.
-- Add more information to the date_views_base_tables() function about why we can't use the entity type from views_fetch_data().
-- Additional handling is needed so that revisions are handled correctly in Views.
-- Remove date_field_get_sql_handler() function which isn't being used anywhere.
-- Rework the Date Views hooks that queue up the right fields and base tables so they work better across all types of entities.
-- Fix the hooks for file tables, it is file_managed, not files.
-- Add a helper function to map entity types to Views base tables to make it easier to know what type of entity is being used on a view.
-- Add status information to Date help screen, hide the non-working change tab on the Date Tools screen, and remove some code that goes to the calendar module from Date Tools.
-
-======================
-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 #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.
-- Issue #1394248, Make sure all date parts are selected when using an exposed select filter.
-- Issue #1425774 by sgabe, Fix error in exposed filter, array_filter() -- first argument should be an array in date_select_input_date().
-- Issue #1432992 by bart.hanssens, Fix typo in php documentation.
-- Issue #323852 by tim.plunkett and arlinsandbulte, Dropdowns shouldn't include a blank option when required.
-- Issue #323852, Validation was broken for unlimited value select widgets with required dates, they were incorrectly getting their end dates cleared out.
-- Issue #1424656 by tim.plunkett, Unify signature and alters of #process callbacks.
-- Issue #1408014 by dasjo, We no longer need the $error_element value to display errors properly, second follow-up.
-- Issue #1299030 by Vincent B: Ensure that 'To Date' is properly marked when required.
-
-======================
-Version 7.x-2.0-rc2
-======================
-
-New Features/Major Changes
-
-- Issue #1358790 by tim.plunkett and redndahead, Store date objects in field_load to speed up processing, with a field setting option to control it.
+Date 7.x-2.11, 2021-03-05
+-------------------------
+#3177831 by DamienMcKenna: Add test coverage for the All Day functionality.
+#3197985 by DamienMcKenna: Expand unit tests for date_is_all_day().
+#3197561 by DamienMcKenna: Add functional tests for All Day output.
+#3016390 by DamienMcKenna, mr.york, steinmb, joseph.olstad, lily.yan,
+  solideogloria, nagy.balint, micahw156, Kevin Morse: Change in "All day"
+  end-of-day definition broke existing data.
+#3164305 by DamienMcKenna, FranckyLFS, hughworm, preethy211, joelpittet,
+  lavamind, derekw, leendertdb: Notices in theme_date_display_combination()
+  after upgrading to PHP 7.4.
+#2123039 by DamienMcKenna, hgoto, RoSk0, joelpittet, torotil: Default timezone
+  setting mismatch in metadata wrapper integration.
+
+
+Date 7.x-2.11-rc1, 2020-10-02
+-----------------------------
+#3084897 by steinmb, Chris Matthews: Fix the LICENSE.txt.
+#2692215 by DamienMcKenna, stickgrinder, zread: Unconditioned access to
+  non-existent array key in date.theme.
+#3111299 by DamienMcKenna: Test refactoring, split out Date Popup tests, move
+  tests to appropriate submodule.
+#2457423 by Liam Morland, ckellyirish, mparker17, DamienMcKenna, bmateus,
+  sagannotcarl, katannshaw, Max1, alansaunders92, derekw, alex awg 2015,
+  truman_ru, wylbur, nicrodgers, ninabyte, Michele Wickham, iStryker, dsdeiz,
+  anpolimus, captainack, ashzade, brad.bulger, cameronprince, Chris Matthews,
+  Vali Hutchison, jenlampton, vishal.sheladiya, jshosseini, akolahi:
+  Incorrectly-initialized DateTime object(s) cause PHP warnings in
+  DateTime::format(), other DateObject functions.
+#2595957 by aurelianzaha, DamienMcKenna, hgoto, klausi, pedrogk, FireHawkX,
+  Chris Matthews: Field label not displayed when rendering as regular field and
+  only using year.
+#2359653 by iamEAP, Sweetchuck, franxo, DamienMcKenna: Validation doesn't take
+  into account translations of AM or PM.
+#3096720 by Liam Morland, ebremner: date_is_all_day() returns FALSE when
+  $granularity is not 'hour' or finer.
+#1257024 by joseph.olstad, maxocub, steinmb, iMiksu, DamienMcKenna, acbramley:
+  Required Date popup field not showing red asterisk.
+#3145639 by Ronino, joelpittet: Curly brace syntax for accessing array elements
+  and string offsets has been deprecated in PHP 7.4.
+#2930732 by NuWans, DamienMcKenna: PHP warning on file_exists fail.
+#3161408 by DamienMcKenna, Ronino: Test failure in DateMigrateTestCase.
+#3163293 by Steven Jones, joseph.olstad: date_update_7007 will fail with
+  different field storage backends.
+#2848963 by joelpittet, DamienMcKenna: date_views_filter_handler_simple
+ ::operators call t() a lot.
+#1762612 by moymilo, cafuego, tamahome14, vanshyr, plachance, steinmb: Error
+  "OLD used in query that is not in a rule" in date_api_update_7000 with pgsql.
+#3168045 by DamienMcKenna: DateFieldTestBase::dateForm extended incorrectly.
+#3168034 by DamienMcKenna: Refactor date_migrate_example to be reusable.
+
+
+Date 7.x-2.11-beta3, 2019-09-22
+-------------------------------
+#1392472 by Taran2L, jvandooren, podarok, jeff h, FluxSauce, maen, solotandem,
+  nickonom, anrikun, JvE, steinmb, joelpittet: Undefined index: timezone in
+  date.field.inc.
+#3022378 by dev11235, DamienMcKenna, joelpittet: Date with empty "Repeats #
+  Weeks" and "Repeats Every # of Days" validation needed.
+#2769057 by id.medion, Chris Matthews, steinmb: Remove unused argument in the
+  function calls field_cache_clear() and field_info_cache_clear(),
+#3033104 by DamienMcKenna: Add a LICENSE.txt file.
+#3032391 by herved, steinmb, skylord, DanielVeza: Empty date fields are being
+  displayed.
+#3033022 by solotandem, steinmb: Correct reference to granularity setting.
+#2701545 by ron_s, Chris Charlton, Chris Matthews, adci_contributor,
+  DamienMcKenna: Add support for Date Popup Timepicker module.
+#3081547 by bhaskar-chakraborty, DamienMcKenna, vijaycs85: Update 7006 breaks
+  when using the field_encrypt module.
+#3032835 by solotandem, DamienMcKenna, steinmb, John_B: Validate input to date
+  filter handler.
+
+
+Date 7.x-2.11-beta2, 2018-10-26
+-------------------------------
+#3009740 by evgeny.chernyavskiy, DamienMcKenna, steinmb: PHP 7.3 compatibility,
+  swtich-continue.
+#1267434 by Ronino, DamienMcKenna, kingandy: Default value for #date_items
+  should be an array in date_field_widget_form().
+#2706965 by DamienMcKenna, arulraj, joelstein: Getting browser autocomplete for
+  date pop fields.
+Reverted #2123039.
+#3010076 by DamienMcKenna, steinmb: Improve coding standards in Date module.
+#3012729 by joseph.olstad, lazzyvn: Bad variable $elent.
+#2843367 by artem0793, Liam Morland, azovsky: String Offset errors on edit page
+  using PHP 7.1.0.
+#2447277 by SebCorbin, steinmb: Performance: replace sylesheets[all][] with
+  attached.
+#2990189 by solotandem, jacob.embree, theaxe, sonnykt: Illegal string offset
+  'value' in date_combo_element_process.
+#2792385 by binoli.addweb, brunodbo, pingwin4eg, joelpittet, DamienMcKenna:
+  Include project namespace in dependency declaration.
+#1138210 by djdevin, kyoder, coltrane, cafuego, JvE: date_sql_handler
+  STR_TO_DATE math incorrect.
+#1415210 by jgullstr, nmudgal, ohthehugemanatee, djdevin, asirjacques,
+  christine1126, steinmb, cydharttha, Jelle_S: Date popup calender doesn't
+  popup when reach to text-field via tab.
+#2894759 by DamienMcKenna, Mansi.AddWeb, hiramanpatil,
+  Michael_Lessard_micles.biz, steinmb: (All Day) : the parantheses are
+  hardcoded.
+#2703401 by jacob.embree, le72, Chris2: Bad assumption about year range format
+  in date_devel_generate().
+
+
+Date 7.x-2.11-beta1, 2018-10-26
+-------------------------------
+#2937071 by DamienMcKenna: Tidy up the CHANGELOG.txt file.
+#2514146 by ram4nd: Remove the .gitignore file.
+#2533080 by jribeiro, DamienMcKenna, rajeev_drupal, badjava: 'clone' is a
+  reserved keyword introduced in PHP version 5.0 and cannot be invoked as a
+  function.
+#2843367 by RemyAroundTown, alesr, joelpittet, DamienMcKenna, oadaeh,
+  ikeigenwijs, johnzzon, Novitsh, matthiasm11, glynster, robertgarrigos,
+  dchatry, szeidler, Majdi, Plazik, NancyDru, nanobyt3: String Offset errors on
+  edit page using PHP 7.1.0.
+#2889636 by MustangGB, ikeigenwijs, Stevel: Fix PHP 7 tests.
+#2503807 by DamienMcKenna: Date Pager position has no effect after updating to
+  Views 3.11.
+#2995679 by Liam Morland, joseph.olstad: PHP 7.1 no longer converts string to
+  arrays the first time a value is assigned with square bracket notation.
+#2889759 by ladybug_3777: Exposed Date Filter - PHP 7 Error.
+#2449261 by daniel_j, pcho, joseph.olstad, David Hernández, collinhaines,
+  vinmassaro, SkyNet Costa Rica: expects an array, not a scalar - Fatal error:
+  Cannot create references to/from string offsets.
+#1741062 by kim.pepper: The merge method of DateObject class has a wrong
+  parameter type.
+#2873415 by Squee3P0, jcisio, rujinxero, digitaltodd, fdverwoerd, Stray14: PHP
+  5.3 - Date field being flagged as Invalid date not actually invalid.
+#2902829 by JayKandari, tucho, nileshlohar, matthiasm11, mr.york, kmonty:
+  Formatter settings for Custom date type is not getting saved.
+#2208769 by Cracu, bunthorne, jeni_dc, Proteo, Reis Quarteu, echoz: Theme hook
+  not found while managing date field.
+#3002449 by plach: Timezone rendered when theming date formats without time.
+#2123039 by Gold, hgoto, DamienMcKenna: Add Entity API as a new test dependency.
+#2123039 by Gold, hgoto, DamienMcKenna, RoSk0, Juterpillar, joachim: Default
+  timezone setting mismatch in metadata wrapper integration.
+#2323857 by anpolimus, DamienMcKenna, claudiu.cristea, catch, joelpittet:
+  date_field_schema() has no index on date.
+#2016787 by r-mo, DamienMcKenna, joep.hendrix, heddn, julien_g: Change date
+  fields to "big" int values to avoid "PDOException 22003" errors.
+#1137062 by El Alemaño, Nelson Lago, bjcooper, ron_s, ronnienorwood, lunazoid,
+  Michael_Lessard_micles.biz, DamienMcKenna, vinmassaro: Follow-up to fix
+  regression on week calculations.
+#1177198 by tim.plunkett, DamienMcKenna, MustangGB, arlinsandbulte, KarenS:
+  Allow CTools to process #dependency for date elements.
+#1778220 by hswong3i, kpyan8s, jacob.embree: Remove version from
+  date_migrate_example.info for better git_deploy integration.
+#2880395 by DamienMcKenna, jojonaloha, GoZ: Fatal error: DateTimeZone could not
+  be converted to string.
+#2100851 by Juterpillar, Drupa1ish, RoSk0, pingwin4eg, acbramley: Date views
+  exposed filter causes SQL error on PostgreSQL.
+#2453445 by DamienMcKenna, dan3h, rahul.nahar001: PDOException not handled when
+  using PostgreSQL without timezone support.
+#2204713 by BR0kEN, jstoller, ebeyrent, gaurav.goyal: Undefined index
+  #default_value in date_select_element_process.
+#2291271 by emek, LoonyLuna, periksson: Datepicker needs dynamic width.
+#2851020 by jacob.embree, nileshlohar, AshwiniPatil, rahul.nahar001,
+  Pranjal.addweb, DamienMcKenna, darshanchoudhary: Use of uppercase for PHP
+  constants.
+#2832257 by danuddara, alexbarrett: Typo error - "The upcoming date less then 1
+  day" - date.theme.
+#2844948 by jiv_e: Notice: Undefined index: tz in date_ical_date().
+#1882432 by DamienMcKenna, lolandese: Improve the module'\''s README.txt files.
+#346752 by rreiss, DamienMcKenna: RTL support.
+
+
+Date 7.x-2.10, 2017-04-07
+-------------------------
+#1037150 by raggax2, vishy_singhal, >antroxim, Risse: date_popup element with
+  just time doesn't work.
+#2648114 by tsapenkoum: DateTime::format(): The DateTime object has not been
+  correctly initialized by its constructor in DateObject->format().
+#2780415 by prince_zyxware, DamienMcKenna: As per Drupal coding standards, use
+  uppercase for PHP constants.
+#2646646 by anpolimus, Stevel, DamienMcKenna: Tests are broken on current
+  7.x-2.x branch.
+#2412049 by Stevel: DateMigrateExampleUnitTest fails if migrate is missing
+#2186191 by kaare, jiv_e, DamienMcKenna, welly, PascalAnimateur, lussoluca,
+  mErilainen, vijaycs85, paulwdru, zerolab, joep.hendrix, marc.groth, podarok,
+  pmackay, idebr, jastraat, WorldFallz, autopoietic, streever: Missing help text
+#2377623 by ekli">Gergely Lekli, qzmenko: Remove unnecessary space in data_combo
+  title.
+
+
+Date 7.x-2.10-rc1, 2016-04-27
+-----------------------------
+#1355256 by develCuy, barraponto, KarenS, jgullstr, Romash: date field minutes
+  and seconds rounding after update/save.
+#1889744 by tatyana, mstrelan, mariagwyn:  PDOException when saving date as unix
+  timestamp.
+#1504202 by seanB, steinmb: Allow entering of custom date format in Views field
+  handlers.
+#2532636 by jstoller: Undefined index: #default_value in
+  date_popup_process_time_part().
+#1699312 by gmclelland, pounard, Niklas Fiekas, azinck, netlooker: Fatal error:
+  Call to undefined function date_field_widget_settings_form_validate() in
+  form.inc.
+#1874422 by danwonac, bluetegu, SeanA, rv0, brockfanning: Pager may cause
+  incorrect "prev" or "next" link.
+#2038057 by vijaycs85, djdevin, pivanov: date_select element's default value as
+  an array raises a warning.
+#2026545 by mistermoper, Jon Nunan: Date field's interval formatter always uses
+  start date.
+#2331975 by BarisW, StryKaizer: Sync end date for the date popup functionality.
+#2339119 by maximpodorov, darkdim: Notice: Undefined index: date in
+  date_text_element_process().
+#2570239 by PascalAnimateur: Display date range as span instead of div
+#2611968 by FluxSauce: PHP Fatal error: Class 'MigrateFieldHandler' not found
+#2160843 by ohokare">nupur.lohokare: Grammar issue: "Date objects can be created
+  and cached as date fields are loaded rather than when they are displayed to
+  improve performance".
+
+
+Date 7.x-2.10-beta1, 2016-01-08
+-------------------------------
+#2325207 by jojonaloha, v1nk, podarok: DateTimeZone could not be converted to
+  string.
+#2469189 by TommyK: Notice: Undefined index: show_remaining_days in
+  date_field_formatter_view() (line 210 of …/date/date.field.inc).
+#1854220 by ryanissamson, paravibe: Add module_exists so that error isn't thrown
+  when disabling date_repeat_field module.
+#2375235 by Lostboy22, steinmb, rsmylski, Jelle_S: Calendar block Next/Prev
+  navigation broken.
+#1889744 by tatyana, mstrelan, mariagwyn: PDOException when saving date as unix
+  timestamp.
+#1797630 by damiankloip, webby7097, Fabianx: 'Is empty(null)' views filter is
+  not working with exposed operators enabled when actual date values are left
+  empty.
+
+
+Date 7.x-2.9, 2015-09-08
+------------------------
+#2072679 by leewillis77: SQLSTATE[42S22] error and no results when multiple
+  dates included in views filter.
+#2503315 by CptCasual: Fatal error: Cannot unset string offsets in
+  date_elements.inc.
+#2543442 by dawehner: Expose site-wide date input format in the UI.
+#1993110 by Hanno, tsyvs, Valentine94: field type not translatable.
+#1675844 by mpdonadio, justin2pin, paravibe, Valentine94: The "Repeat" checkbox
+  does not open / close the correct fieldset in some circumstances.
+
+
+Date 7.x-2.9-rc1, 2015-03-27
+----------------------------
+#2199587 by oadaeh, jmuzz: Second validation of date popup causes error.
+#2374287 by vijaycs85, herd45: Error messageNotice: Undefined index: value in
+  date_views_select_validate.
+#2420323 by Michelle: Exposed date filter shouldn't automatically set a default
+  date if none requested.
+#1437892 by stefan.r, interdruper: Undefined index notices in date_popup.module
+  and default values disappear.
+#2372073 by vijaycs85, Lostboy22, maximpodorov, stefan.r: Undefined variable:
+ granularity in date_views_plugin_pager->query() (line 285 of date_views
+ /includes/date_views_plugin_pager.inc.
+#2451027 by Chewie, stBorchert: Migrate module: undefined index timezone error.
+#206127 by TravisCarden, BenPoole, dwightaspinwall, nerdcore, georgir: Add
+  ability to sort Views exposed filters SELECT lists in reverse.
+#2235393 by Pere Orga, andrdrx: CSS pseudoselector 'ends with' should not be
+  used with the class attribute.
+#1078788 by jacob.embree, mgifford: Coder issues in Date.
+#1137062 by Sylvain Lecoy, schifazl, hughworm: date_week_range and
+  date_iso_week_range both returns 1 day too much.
+
+
+Date 7.x-2.9-beta2, 2014-12-04
+------------------------------
+#1166036 by andriyun | Palmeus: Showing the remaining days until event.
+#2359673 by korgik: Fixed Wrong condition in removeGranularity method.
+#2375605 by cosmicdreams, ssdas: When configured to use Date's timezone and
+  using a muti-value date field, I expect each date field to remember the
+  timezone that was set.
+#2371471 by schifazl, anrikun, esomething, MXT, maximpodorov, alayham,
+  Lostboy22, k.skarlatos: Error with entity_metadata_wrapper for Date Field with
+  Start But No End.
+#2332181 by bneil, cafuego: Add update hook for date_views variables.
+
+
+Date 7.x-2.9-beta1, 2014-11-08
+-------------------------------
+#2366199 by vlad.dancer: Sniffer fixes.
+#2325425 by catch: Fixed Trim input dates in date_popup.
+#2238135 by Valentine94, cs_shadow, e5sego: Fixed 0 (zero) time value will be
+  rejected.
+#2277107 by LinL: Fixed Date API's Status report entry repeats the word "to".
+#2367791 by sergiuteaca: Fixed Extra white space before full stop on Repeat
+  title.
+#2367779 by andreyks, sanchiz: Fixed Regression in date_popup.js after code
+  cleanup.
+#1246940 by yingtho, andreyks | acbramley: Added more custom formats for Date
+  Popup.
+#1909566 by Valentine94, Ronino: Fixed Devel generate fails for date fields
+  with absolute years in ranges.
+#1997774 by Valentine94, ryan.armstrong, haggins: Added Update Time Entry plugin
+  to 1.5.2.
+#2369691 by sanchiz: Code standarts in date.theme.
+#1487700 by Valentine94, Jorrit, El Alemaño | casey: Added Views date pager,
+  option to skip empty pages.
+#1878970 by Elijah Lynn, Valentine94: Fixed Entering 4 digit year manually.
+  Extra spacing at beginning/end is not trimmed, results in validation error.
+#2279831 by itarato: Fixed Date field validation breaks if it's coming from a
+  Panels visibility rule.
+#1467712 by ankur_novatree, anrikun, jmonkfish, fledev, MustangGB, DuaelFr,
+  jibran, l0coful: Added Make it possible to disable fieldset for date field.
+#2026811 by kala4ek, forgenator: Fixed Views argument in contextual filter
+  doesn't have all granularity options.
+#2367595 by jbubik: Fixed 'r' formatter produces RFC2822-incompliant results in
+  non-English environment.
+#2361671 by mfernea: Fixed Notice returned in
+  date_default_formatter_settings_summary when using custom settings.
+#1885270 by Eduardo Alvarez, mareksal, JvE | haffmans: Fixed UTC time zone
+  handling shows UTC, not converted, date/time.
+
+
+Date 7.x-2.9-alpha2, 2014-09-24
+-------------------------------
+#2309015 by msankhala, Temoor: Fixed views date field exposed filter default
+  value not being added in $form_state['input'] when initially views loads.
+#2323191 by guillaumev: Fixed Issue with testing.
+#2313587 by BWPanda: Fixed Incorrect permission name.
+
+
+Date 7.x-2.9-alpha1, 2014-07-31
+-------------------------------
+#2294973 by lsabug, micahw156, keesje: Fixed Date format in calendar title
+  remains default.
+
+
+Date 7.x-2.8, 2014-07-29
+------------------------
+#106713 by vijaycs85, heddn: Date Field title XSS(SA).
+#2310123 by Temoor: Fixed Fatal error in Migrate UI by Date Migrate Example.
+#2142277 by Temoor, lliss: Fixed Infinite Loop When Using Repeating Dates.
+#1871136 by Temoor, funkimunky: Fixed Cannot remove migrate example content
+  type.
+#2261395 by minorOffense, kristofferwiklund: Fixed date_now is not respecting
+  changes to timezone.
+#1832400 by imot3k, balintk: Fixed "The year/month/... is missing" error message
+  is not translatable.
+#998076 by coredumperror, joelcollinsdc, brenk28: Fixed Problem with timezone
+  handling (caused by date_get_timezone_db returning only UTC).
+#1976014 by Harmageddon: Remove unnecessary &nbsp; in date views pager.
+#2198807 by stickywes: Refactor field tests to utilize DateFieldTestBase.
+#2146461 by vijaycs85, Razia_b: Fixed Translated field's label is not used in
+  its validation messages.
+#1874422 by bluetegu, brockfanning, rv0: Fixed Week pager may cause incorrect
+  "next" link on year change.
+#2167015 by schifazl: HTML output breaks validation and accessibility.
+#2200513 by scor: Fix encoding issues in CHANGELOG.txt.
+#2115377 by coredumperror: Notice: Undefined index: add_microdata in
+  theme_date_display_single().
+#2178299 by sandykadam, joachim: Incorrect variable name in
+  hook_views_data_alter().
+#1431952 by Cadila, Shawn DeArmond: Date field will only set in Rules if it
+  already has a value.
+#355058 by Grimreaper, prunelle: Hardcoded day/month/week output format for
+  theme_date_nav_title().
+#1968828 by pjcdawkins: Replace field_info_fields() with field_info_field_map()
+  for Drupal >= 7.22.
+#2167033 by podarok, vijaycs85: Fixing tests in 2014.
+
+
+Date 7.x-2.7, 2013-12-21
+------------------------
+#1691342 by Cyberwolf: Field description is displayed multiple times.
+#1668240 by ianthomas_uk: /themes/jquery.timeentry.css is not aggregated with
+  other CSS files.
+#1974056 by pjcdawkins: Add a CSS class to the date repeat rule.
+#2065749 by vijaycs85, blackdog: $class in theme_date_repeat_rrule is not used.
+#1840008 by cr0ss, Alan D: Unlock "Date attributes" (granularity) field setting.
+#1580032 by jmuzz, 30equals: Date values are not being saved when field is used
+  in a nested field collection.
+#2071629 by blackdog: #after_build wrongly added, overwrites other modules.
+#1869962 by kaidjohnson: Date Context breaks context edit form.
+#1571258 by David_Rothstein, ddalvi: Date and time form elements do not have
+  accessible labels when the label position is set to 'Within' or 'None'.
+#2130575 by kostajh: Unset() should be used with more caution in
+  views_filter_handler_simple().inc.
+#1826598 by eromba, jyee: 'c' and 'r' formatter causes date to be printed twice
+  in views.
+#1933472 by minorOffense: Added Optimize date_now() function.
+#1248786 by kenneth.venken, dboulet: Fixed appearance of marker for required
+  date fields.
+#1810734 by ParisLiakos: Fixed Repeat checkboxes working reversed with updated
+  jQuery.
+#1844092 by dboulet, kardave, Spleshka: Fixed Untranslated strings: month, day,
+ ...
+#1202248 by james.williams, dawehner, mikehues, DamienMcKenna: Fixed Exported
+  view doesn't include 'default_argument_options()' attribute.
+#1409120 by anrikun, akamustang, marsbidon: Added Date format in views exposed
+  filter does not respect configured format.
+#1858112 by tomdearden: Fixed DateObject->difference not calculating correctly
+  for future dates > 1 year away.
+#1659466 by artkon: Fixed Date filter does not remember value in views if the
+  identifier is something other than date_filter().
+#1905096 by gielfeldt: Fixed Wrong usage of database API.
+#1791804 by 5n00py: Errors on form validation if date field placed in sub-form.
+#636208 by KarenS: Date range: Expose a single filter to select events that
+  start before the chosen date and end after the chosen date by anrikun.
+#2024269 by KarenS: Date popup documentation fix by RoySegall.
+#1835184 by Steven Jones, das-peter, jwhat: Fixed date_limit_format() can have
+  poor performance.
+#991830 by milesw, restyler: Fixed validation errors when date_popup() date is
+  localized.
+#2098715 by jhodgdon: Fixed Date field not obeying widget alters for #required.
+#1266688 by linclark, rbayliss, fago, colette: Support microdata in date fields.
+#1863610 by maximpodorov: Fixed Invalid date formatting.
+#2034231/#1832544 by mikeryan: Class registration for Migrate 2.5 or later.
+#1835214 by PatchRanger: Automated tests failing - Exception thrown in Date2
+  migration.
+#1350604 by Alan D., johaziel: Added Diff support for Date fields.
+#2086313 by dooug: Fixed Wrong path in date_popup() README.txt
+#1455558 by BTMash, mediameriquat: Fixed Missing file in date_views().info
+  causes error 500.
+#1697322 by Alan D., ianmthomasuk, pandikamal: Fixed Call to a member function
+  getName() on a non-object in date api.
+By KarenS: Code cleanup, remove #prev values that were never used in repeat
+  functionality.
+By KarenS: Small fix needed to ensure cardinality gets set correctly if repeat
+  option is changed in the UI.
+
+
+Date 7.x-2.6, 2012-08-13
+------------------------
+#1423364 by catmat: Add file and path to hook_context_plugins().
+#1713248 by KarenS: Remove incorrect use of date_popup() function in previous
+  commit.
+#1143680 by kristiaanvandeneynde: Make Date Popup widget able to accept custom
+  settings.
+#1596546 by applicity_sam: Make sure incorrect month name creates validation
+  error.
+#1432702 by KarenS: Fix some miscellaneous problems with date example dates and
+  formats.
+#1512464 by Liam Moreland: Allow for undefined formatter in Date upgrade
+  handling.
+#1659638 by bojanz: Hide install message if Drupal is not installed (i.e. in
+  install profiles).
+#1605158 by covenantd: Be sure value2 is initiated in Date Context handler.
+#1355256 by barraponto, develCuy, KarenS: Set default value for date text
+  widget increment to 1, and update existing fields.
+#1561306 by Cyberwolf: Date pager replacement was not working correctly when
+  used with multiple dates.
+#1541740 by hass: Make Date requirements more easily translatable.
+#1543524 by iamEAP: Add update hook to remove the D6 date_timezone field from
+  users.
+#1603640 by bevan: Don't return anything for empty date interval.
+#1235508 by KarenS: Make sure that ISO strings with '00' in the month and/or day
+  don't create dates for the previous month and day.
+#1289270 by pdrake: Fixed date arguments and filters do not work with
+  relationships.
+#895760 by Reinette: Added RFC2447 option 'STATUS' to date_api_ical().inc.
+#606658 by johnmunro, KarenS, Make sure ical import processes multi-day all-day
+  events correctly.
+#1408216 by KarenS: Need to be sure that NULL is the default state for the SQL
+  functions.
+#1540410 by KarenS: Update the Date Tools calendar creation wizard to use the
+  new calendar path.
+
+
+Date 7.x-2.5, 2012-04-19
+------------------------
+By KarenS: Fix nasty errors on views that have no row indexes, like the frontage
+  view.
+
+
+Date 7.x-2.4, 2012-04-19
+------------------------
+#1534342 by bass: Make name of clean pager option easier to translate.
+By KarenS: Add a hook to alter the default date for a Date argument.
+#1531904 by KarenS: Make sure that multiple value dates that have the delta set
+  only display the selected value.
+Revert Issue #1266688 by fago, This change broke Entity token support.
+
+
+Date 7.x-2.3, 2012-04-01
+-------------------------------
+#1444804: Remove html placeholder on text widget.
+#1286230: Clean up date pager documentation, it contains deprecated information.
+#1469020: Make sure page not found is working right for dates outside the
+  specified range.
+#1111626: Fix some problems caused by passing in a date string with an offset.
+#1477860: Avoid undefined index errors in date_views_select_validate().
+#1469038: Add some clarity to the BYDAY description options and make sure a
+  valid value is selected.
+#1405364 by snufkin: Add display options to format_interval to match Views
+  interval options.
+#1266688 by linclark: Add microdata support to Date metadata.
+#1509434 by casey: Add timezone info in hook_field_presave() instead of
+  hook_field_insert() and hook_field_update().
+#1509012, Fix fatal error when viewing repeat tab.
+#1037174 by dealancer: More work to allow ajax to work on other widgets.
+#1473592 by zabelc: Make sure migrated date with missing end date still gets
+  imported correctly.
+#1442718 by jastraat, bones: Make sure show end date checkbox does not display
+  when end date is empty.
+#1504556 by KarenS: Fix invalid access permission name in Date API configuration
+  menu.
+#1484458 by KarenS: Vega timepicker code was incorrectly computing the default
+  date because of the wrong format for the value passed to it.
+#1459668 by KarenS: Add back Remove date_field_get_sql_handler() function
+  temporarily since Signup module is still using it. Mark it deprecated.
+#1478296 by KarenS: Display longer abbreviations for day names in date repeat
+  widget so they can be translated.
+#1488662 by martin.heidegger: Make error message more easily translatable.
+#1478848 by onelittleant: Don't set default values on new translation entities.
+#1360672 by KarenS: Fix limit format code to remove leftover non-ascii text as
+  well as leftover ascii text.
+#1464280 by geerlingguy, Georgique, dealancer: Fix notice when using exposed
+  between filter.
+#1484640 by onelittleant: Some entities may not have base tables.
+#1472966 by KarenS: Get rid of notice that appears for entities without repeats.
+By KarenS: Move pager css around. Some code in Calendar and Date API belongs in
+  Date Views.
+By KarenS: Fix Date Popup default format which was ending up using 24 hour time
+  no matter what format was used for short format.
+By KarenS: Remove outdated _repeat widget name from Date Tools.
+By KarenS: Date Tools is defaulting to creating a calendar even if Calendar
+  module is not enabled.
+#1472148 by arlinsandbulte: wvega jQuery time-picker doesn't show scrollbar.
+#1392128 by kidrobot, tim.plunkett, willvincent: Fixed Repeats tab shows on
+  nodes with non-repeating dates.
+#1452882 by coredumperror: Fixed Date Migrate Example doesn't deregister it's
+  migration when disabled.
+#1452408 by reglogge: Fixed Trailing dots are removed from date formats even if
+  they are needed for the format.
+#1285260 by Steven Jones: Fixed 'Starting from' display option.
+#1467244 by bluetegu: Fixed Recurring Sunday errors.
+#1442718, Empty default values were getting populated by the code that tried to
+  fix default values on hidden fields.
+By KarenS: Make sure date_handler->placeholders gets initialized even for
+  queries that don't execute so the pager won't throw an exception if the value
+  is missing.
+
+
+Date 7.x-2.2, 2012-02-24
+------------------------
+By KarenS: The iCal templates were removed and moved to the new Date iCal module
+  (http://drupal.org/project/date_ical).
+#1423364 by emptyvoid, Move Date context plugin into its own file.
+#1447372 by yched, Memory friendlier version of date_repeat_field_bundles().
+#1447140 by tim.plunkett: Remove iCal-related theme functions/files.
+#1284170 by benjifisher, Lots of cleanup of the iCal export and its template to
+  be sure all day items are exported correctly.
+#1346424, The calendar title got left out of the latest ical template changes.
+By KarenS: Add more information to the date_views_base_tables() function about
+  why we can't use the entity type from views_fetch_data().
+By KarenS: Additional handling is needed so that revisions are handled correctly
+  in Views.
+By KarenS: Remove date_field_get_sql_handler() function which isn't being used
+  anywhere.
+By KarenS: Rework the Date Views hooks that queue up the right fields and base
+  tables so they work better across all types of entities.
+By KarenS: Fix the hooks for file tables, it is file_managed, not files.
+By KarenS: Add a helper function to map entity types to Views base tables to
+  make it easier to know what type of entity is being used on a view.
+By KarenS: Add status information to Date help screen, hide the non-working
+  change tab on the Date Tools screen, and remove some code that goes to the
+  calendar module from Date Tools.
+
+
+Date 7.x-2.1, 2012-02-14
+------------------------
+#1437242 by zerbash, Remove extraneous leading slashes in module_load_include().
+#1436722 by hefox: Fixed Undefined variable $form_set_error() used as function.
+#1250626 by Gábor Hojtsy, B-Prod, hefox: Added start date and end date labels.
+#1253482, Make sure $argument->is_default gets reset by the Date pager when
+  altering results.
+By KarenS: Adjust Date Tools to work with changes to use Views templates to
+  create calendars.
+#1398584 by dhalbert and KarneS, Make sure groupby times is initialized.
+#1394248 by KarenS: Make sure all date parts are selected when using an exposed
+  select filter.
+#1425774 by sgabe: Fix error in exposed filter, array_filter() -- first argument
+  should be an array in date_select_input_date().
+#1432992 by bart.hanssens: Fix typo in php documentation.
+#323852 by tim.plunkett and arlinsandbulte, Dropdowns shouldn't include a blank
+  option when required.
+#323852 by KarenS: Validation was broken for unlimited value select widgets with
+  required dates, they were incorrectly getting their end dates cleared out.
+#1424656 by tim.plunkett: Unify signature and alters of #process callbacks.
+#1408014 by dasjo: We no longer need the $error_element value to display errors
+  properly, second follow-up.
+#1299030 by Vincent B: Ensure that 'To Date' is properly marked when required.
+
+
+Date 7.x-2.0-rc2, 2012-02-01
+----------------------------
+New Features/Major Changes:
+#1358790 by tim.plunkett and redndahead: Store date objects in field_load to
+  speed up processing, with a field setting option to control it.
+
+Bugfixes:
+#1423598 by KarenS: Found a way to flag items that are new so we know when to
+  add default values.
+By KarenS: Made some fixes to find and test the right entities when checking
+  whether to use default values. More work is needed.
+#1422600 by KarenS: Make sure end date cannot cause validation errors when show
+  end date checkbox is not checked.
+#1417872 by KarenS: Remove code to compute missing date parts from empty values
+  now that the new validation prevents that from working.
+#1417872 by KarenS: Make sure empty year field is validated in the same way
+  other date parts are validated.
+By KarenS: Alter date field test to test with a complete end date instead of
+  using empty elements.
+By KarenS: Fix broken logic in repeat additions.
+By KarenS: Fix test broken by date repeat clean up.
+#1419106 by hanoii: Added more info to hook_date_text_process_alter().
+#1209026 by KarenS: When date validation fails, Date Popup value is getting
+  cleared.
+#1017216 by tim.plunkett, arlinsandbulte: Added custom date format without time
+  shows 'all day'.
+#1408014 by dasjo: We no longer need the $error_element value to display errors
+  properly.
+#554546 by master-of-magic: Fix Timezone list translation
+#1411038 by jhodgdon: Fixed Date formatting is not obeying granularity.
+#1359464 by KarenS: Make sure that default values on hidden elements have the
+  same construct as loaded values to avoid errors.
+#1399744 by tim.plunkett: Rework the way filter groups are used to be sure the
+  Date filter group does not clobber the Views filter group.
+#1411862 by KarenS: Move the date_views_fields() function into date_view.module
+  to be sure it is always available.
+#1380350 by KarenS: Rework SQL query handling to pass in a comparison date for
+  computing offsets to better handle dates affected by DST adjustments.
+#1359464 by KarenS: Temporary fix for broken handling of repeating dates on
+  users with a TODO to figure out where it's coming from.
+#1404494 by byrond: Make sure hidden formatters don't get switched to
+  date_default in update hook.
+#1386012 by KarenS: Order weekdays in Date Repeat form to match the site first
+  day of week settings.
+#1376476 by pbfleetwood: Add commas to default formatting of week and day
+  headers.
+#1408430 by KarenS: Views pagination with exposed, unset, filters, results in
+  invalid default values. Treat them as empty input.
+#1408996 by KarenS: Exposed Date Popup widget with time not correctly
+  initialized.
+#1271726 by KarenS: Text widgets in exposed filters used with pagers produce
+  unexpected results.
+#1096000 by KarenS: Custom date formats not working right.
+#1405364 by KarenS: Format interval settings were getting overridden by missing
+  break.
+#1387890 by KarenS: Make sure disabled fields are shown and retain their
+  original values.
+#1402232 by timplunkett: Switch 'Implementation of' to 'Implements'
+#1402236 by timplunkett: All functions should be prefixed with your module name
+  to avoid name clashes
+#1402238 by timplumkett: Remove references to CCK
+#1011624 by KarenS: Filters and arguments were not always using the right base
+  table to select field options, causing 'column missing' errors.
+#1397822 by KarenS: Fix 'Undefined index: field' error on line 207 of
+  date_views_filter_handler_simple.inc.
+#1396536 by KarenS: Repeating fields weren't getting created with Devel Generate
+  because of the change in widgets. Add new hooks so Date Repeat Field can add
+    the repeats.
+#1397126 by arlinsandbulte: Fix broken tests.
+#1397158 by KarenS: The default value for the end date was using the wrong
+  timezone setting.
+#1392128 by kidrobot, tim.plunkett: Don't show repeat tab unless the date is
+  repeating.
+#1397126 by KarenS: Add Date API section to administration menu and consolidate
+  Date Popup and Date Tools settings there.
+By KarenS: Follow up to Issue #1302052 by benjifisher, More clean up of ical
+  line endings.
+#1388174 by travist: Remove redundant use of date_default_timezone().
+#1388586 by Moloc: Don't use check_plain() on system messages with links.
+#1302052 by benjifisher, penguin25, helmo: Fix linespace ending problems in ical
+  files.
+#1357216: The Date Views field list was including the Date Views filter itself,
+  creating errors about missing node.date_filter values.
+#1259870: Reinstate the test for a missing date argument for the pager.
+By KarenS: The new option to hide the add_delta for simple fields needs to be
+  adjusted to work right where there is no field.
+By KarenS: Tweak the all day formula to check for 59:59 even for items that use
+  increments, to help fix problems when the calendar creates all day values.
+By KarenS: Our test for whether this is a Date argument or filter needs to
+  include a check that the field was actually processed by Date Views. Some
+    dates are not.
+By KarenS: Revert the change to 7.8. It breaks the modules page.
+#1379172 by deviantpixel: Note that the Date Repeat form uses a function that
+  was re-named in 7.8.
+By KarenS: Store the locale format in a static cache to avoid re-computing it
+  dozens of times on calendar views.
+By KarenS: Sheesh. Fix syntax error in api.date.php.
+
+
+Date 7.x-2.0-rc1, 2011-12-20
+----------------------------
+The Date Browser has been removed. Please use the Date Pager instead. If you
+have existing views using the Date Browser the navigation will just disappear
+from them. If you add a Date Pager to the view you should get it back. Then
+delete the Date Browser attachment from the view, since it doesn't do anything
+any more.
+
+The UNTIL date was not getting included in repeating results and that is now
+fixed. This is an API change of sorts for anyone who worked around the issue by
+setting it ahead.
+
+The All Day checkbox and All Day themes were moved into a separate module, using
+new hooks added to the date processing. This module should serve as an example
+of how other modules can inject functionality into date fields.
+
+A new module has been added for integrating the Date Repeat API into date
+fields. Some of this code has been moved into the new module, more of it will be
+moved later as I figure out how to unwind it from the base processing. An update
+hook has been added to enable this module by default for existing sites. If you
+don't use Repeating dates you can disable it.
+
+New Features/Major Changes:
+#1229378 by ksenzee: Sync the end date with the start date on new dates using
+  select widgets.
+#1236216 by KarenS: Move the repeating date integration out of the Date module
+  and into a separate, Date Repeat Field module.
+#874322 by KarenS: The All Day functionality has been moved into a separate
+  module and hooks were added to make it easier for other modules to inject
+  steps into date processing.
+#1267046 by KarenS: Include the UNTIL date in repeating results.
+#1354606 by temaruk: Rework the repeating date UI to make it more user-friendly.
+#1362654 by KarenS: Remove Advanced Help integration, it needs a total rewrite.
+#1357362 by KarenS: Remove Date Browser, use Date Pager instead.
+#1354606 by KarenS: Make sure COUNT option without UNTIL date can be handled
+  correctly by repeating date computations.
 
 Bugfixes
-
-- Issue #1423598, Found a way to flag items that are new so we know when to add default values.
-- Made some fixes to find and test the right entities when checking whether to use default values. More work is needed.
-- Issue #1422600, Make sure end date cannot cause validation errors when show end date checkbox is not checked.
-- Issue #1417872, Remove code to compute missing date parts from empty values now that the new validation prevents that from working.
-- Issue #1417872, Make sure empty year field is validated in the same way other date parts are validated.
-- Alter date field test to test with a complete end date instead of using empty elements.
-- Fix broken logic in repeat additions.
-- Fix test broken by date repeat clean up.
-- Issue #1419106 by hanoii: Added more info to hook_date_text_process_alter().
-- Issue #1209026, When date validation fails, Date Popup value is getting cleared.
-- Issue #1017216 by tim.plunkett, arlinsandbulte: Added custom date format without time shows 'all day'.
-- Issue #1408014 by dasjo, We no longer need the $error_element value to display errors properly.
-- Issue #554546 by master-of-magic: Fix Timezone list translation
-- Issue #1411038 by jhodgdon: Fixed Date formatting is not obeying granularity.
-- Issue #1359464, Make sure that default values on hidden elements have the same construct as loaded values to avoid errors.
-- Issue #1399744 by tim.plunkett, Rework the way filter groups are used to be sure the Date filter group does not clobber the Views filter group.
-- Issue #1411862, Move the date_views_fields() function into date_view.module to be sure it is always available.
-- Issue #1380350, Rework SQL query handling to pass in a comparison date for computing offsets to better handle dates affected by DST adjustments.
-- Issue #1359464, Temporary fix for broken handling of repeating dates on users with a TODO to figure out where it's coming from.
-- Issue #1404494 by byrond, Make sure hidden formatters don't get switched to date_default in update hook.
-- Issue #1386012, Order weekdays in Date Repeat form to match the site first day of week settings.
-- Issue #1376476 by pbfleetwood, Add commas to default formatting of week and day headers.
-- Issue #1408430, Views pagination with exposed, unset, filters, results in invalid default values. Treat them as empty input.
-- Issue #1408996, Exposed Date Popup widget with time not correctly initialized.
-- Issue #1271726, Text widgets in exposed filters used with pagers produce unexpected results.
-- Issue #1096000, Custom date formats not working right.
-- Issue #1405364, Format interval settings were getting overridden by missing break.
-- Issue #1387890, Make sure disabled fields are shown and retain their original values.
-- Issue #1402232 by timplunkett, Switch 'Implementation of' to 'Implements'
-- Issue #1402236 by timplunkett, All functions should be prefixed with your module name to avoid name clashes
-- Issue #1402238 by timplumkett, Remove references to CCK
-- Issue #1011624, Filters and arguments were not always using the right base table to select field options, causing 'column missing' errors.
-- Issue #1397822, Fix 'Undefined index: field' error on line 207 of date_views_filter_handler_simple.inc.
-- Issue #1396536, Repeating fields weren't getting created with Devel Generate because of the change in widgets. Add new hooks so Date Repeat Field can add the repeats.
-- Issue #1397126 follow-up by arlinsandbulte, Fix broken tests.
-- Issue #1397158, The default value for the end date was using the wrong timezone setting.
-- Issue #1392128 by kidrobot and tim.plunkett, Don't show repeat tab unless the date is repeating.
-- Issue #1397126, Add Date API section to administration menu and consolidate Date Popup and Date Tools settings there.
-- Follow up to Issue #1302052 by benjifisher, More clean up of ical line endings.
-- Issue #1388174 by travist, Remove redundant use of date_default_timezone().
-- Issue #1388586 by Moloc, Don't use check_plain() on system messages with links.
-- Issue #1302052 by benjifisher, penguin25, and helmo, Fix linespace ending problems in ical files.
-- Issue #1357216, The Date Views field list was including the Date Views filter itself, creating errors about missing node.date_filter values.
-- Issue #1259870, Reinstate the test for a missing date argument for the pager.
-- The new option to hide the add_delta for simple fields needs to be adjusted to work right where there is no field.
-- Tweak the all day formula to check for 59:59 even for items that use increments, to help fix problems when the calendar creates all day values.
-- Our test for whether this is a Date argument or filter needs to include a check that the field was actually processed by Date Views. Some dates are not.
-- Revert the change to 7.8. It breaks the modules page.
-- Issue #1379172 by deviantpixel, Note that the Date Repeat form uses a function that was re-named in 7.8.
-- Store the locale format in a static cache to avoid re-computing it dozens of times on calendar views.
-- Sheesh. Fix syntax error in api.date.php.
-
-======================
-Version 7.x-2.0-rc1
-======================
-
-Notes:
-The Date Browser has been removed. Please use the Date Pager instead. If you have existing views using the Date
-Browser the navigation will just disappear from them. If you add a Date Pager to the view you should get it back.
-Then delete the Date Browser attachment from the view, since it doesn't do anything any more.
-
-The UNTIL date was not getting included in repeating results and that is now fixed. This is an API change of sorts
-for anyone who worked around the issue by setting it ahead.
-
-The All Day checkbox and All Day themes were moved into a separate module, using new hooks added to the date
-processing. This module should serve as an example of how other modules can inject functionality into date fields.
-
-A new module has been added for integrating the Date Repeat API into date fields. Some of this code has been
-moved into the new module, more of it will be moved later as I figure out how to unwind it from the base
-processing. An update hook has been added to enable this module by default for existing sites. If you don't
-use Repeating dates you can disable it.
-
-New Features/Major Changes
-
-- Issue #1229378 by ksenzee, Sync the end date with the start date on new dates using select widgets.
-- Issue #1236216, Move the repeating date integration out of the Date module and into a separate, Date Repeat Field module.
-- Issue #874322, The All Day functionality has been moved into a separate module and hooks were added to make it easier for other modules to inject steps into date processing.
-- Issue #1267046, Include the UNTIL date in repeating results..
-- Issue #1354606 by temaruk, Rework the repeating date UI to make it more user-friendly.
-- Issue #1362654, Remove Advanced Help integration, it needs a total rewrite.
-- Issue #1357362, Remove Date Browser, use Date Pager instead.
-- Issue #1354606, Make sure COUNT option without UNTIL date can be handled correctly by repeating date computations.
-
-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 #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.
-- Issue #1248520 by fearlsgroove, Use attribute selector on all day and end day checkboxes.
-- Issue #952446 and #1031690, Select dates with only year and month were not working.
-- Issue #1292152 by pfrenssen, Remove debug functions.
-- Issue #1338976 by Josh Benner, Adjust iCal unwrap to allow for leading spaces, per standard.
-- Issue #1352486 by d.novikov, Rework date SQL formatting for Microsoft SQL.
-- Issue #1266536, Keep timezone adjustments from altering the values for repeating date EXCEPTIONS and ADDITIONS.
-- Issue #1353488, Some repeating date calculations using PHP 5.3.6+ were not computing correctly.
-- Issue #1364026, Fix link to documentation, also move help to Date API module.
-- Issue #1276270, Fix fatal error when using repeat date on user.
-- Issue #1362758, Add empty file for the date_plugin_display_attachment.inc file that was removed, to avoid fatal errors if it is missing on a site that formerly used it.
-- Issue #1363460, Make sure widget dates do not end up with the current date when they should be empty.
-- Issue #1353488, Attempt to fix problem using date_date_set() in PHP 5.3.6+.
-- Date Migrate tests needed some fixes to conform to latest code.
-- Issue #1353790, Hide missing index notice if the value in the Date Popup does not match the expected value, it will still get trapped as a validation error.
-- Issue #1353790, Make sure Date Popup properly translates the default value if it includes month or day names.
-- Issue #1217796, Make sure that All Day formatting works correctly even if the All Day label is empty.
-- The repeat description was lost by a recent change to the theme that sent the element through the theme twice.
-- Remove date_get_nested_elements() function. Not being used and I don't want other code to start expecting it.
-- Issue #1266144, The end date should get set to blank if it is optional and matches the start date, but only if it is not populated by default values.
-- Issue #1349510, Make sure default values get populated before processing so they still get set on hidden fields.
-
-======================
-Version 7.x-2.0-alpha5
-======================
-
-Notes:
-The date repeat widgets have been removed to keep users from trying to change repeating dates into non-repeating dates.
-There are now just three widgets, Date Select, Date Text, and Date Popup. Whether or not a date is a repeating date
-is now controlled by a field setting.
-
-New Features/UX Changes/API Changes
-
-- Issue #1304056 by DamienMcKenna, Add option to date_difference to indicate direction of difference.
-- Issue #1238660, Add custom format option for the date format used in summary arguments.
-- Issue #1038482 by somanyfish, iCal import failing due to colon instead of semi-colon
-- Issue #1252952 by eosrei: Make "all day" checkbox configurable on a per field instance basis.
-- Issue #1266144 by arlinsandbulte: Clarify Default End Date Setting
-- Issue #1261478 by stevector and KarenS, Reconfigure the back/next buttons into item lists so Views ajax pager works right.
-- Issue #1262960, Add a new module to work with the Context module to set a condition based on the value of a date field.
-- Issue #1216878, Re-introduce 'repeat' as a field setting rather than a widget type so people can't try to switch back and forth between repeating and non-repeating dates. Eliminate repeat widgets.
-
-Bugfixes
-
-- Issue #1280658 and follow up to Issue #1238660 by KarenS and tockliasteroid, Rework the format control over the summary title and apply it to the title() callback.
-- Issue #1276622 by ArtistConk, Make sure Except date contains no default value.
-- Issue #1153766 by fago, More work on the entity property setters and getters.
-- Issue #1331214, Make sure Date Migrate properly handles empty date values.
-- Issue #1285224, Make sure Date Migrate works for importing repeating dates now that widgets have changed.
-- Issue #1162290, Make sure date for example formats avoids confusing short and long month names.
-- Re-organize handling of custom date formats.
-- Issue #1122038, Make sure empty values are not passed to Views to be themed for repeating dates.
-- Issue #1101284 by pfournier, Expand regex for Month names to catch more possible variations.
-- Issue #1343406 by slashrsm, add back the caching of the views fields list.
-- Issue #1302374 by miro_dietiker, Account for an inconsistency in core handling of non-existant date formats.
-- Issue #1344014 by James Sharpe, Get rid of 'Repeats every 0 days' description.
-- Issue #1302212, Change the way default dates using custom code are created.
-- Issue #1292898, Check for all day checkbox in the basic date element validation so empty time for newly added elements still passes validation.
-- Issue #1252952 follow up, Move checkbox setting to the same spot where time is set, and don't show option on dates without time.
-- Issue #1335818 by joelpitter, Don't create a date for empty values in the date getters and setters.
-- Issue #1271726, Keep default_value out of exposed form so it won't show up in pager.
-- Issue #1017866, Fix miscellaneous problems where filter/argument incorrectly do timezone adjustment.
-- Issue #1103032, Attempt to add setters to date entity metadata so Rules can use them.
-- Issue #1153766, Adapt metadata functions to the pattern in the current Entity code, add $info to the getters.
-- Issue #1278876 by basicmagic.net, Typo in date.css
-- Issue #752550 by Fonant, Week number gets printed twice
-- Issue #1052586 by jpsolero, Problem with Date API when using Calendar with argument set to "Week" granularity and "current date" default argument
-- Issue #1266144, End date same as start date default not being respected.
-- Issue #1239934 by casey, Fix javascript exception in date_year_range.js.
-- Issue #1310558, Don't show extra label on exposed date filter.
-- Fix bug in Date Popup that still uses the current date when the default date is empty.
-- Issue #1335578 by aaronbauman, Make it possible to pass in +/- 1000 years to years back/forward.
-- Issue #1292516 by mcarbone, Fix Uninitialized string offset in Date Migrate.
-- Issue #1084980 by jwilson3, Set default value for $granularity to be array in date_formatter_format.
-- Issue #1227350 by grendzy, Summary view should not be calling date_forbid().
-- Issue #1286570, Fix undefined index error caused by using a remember value without checking if it exists.
-- Issue #1337440 by phoenix, Fix syntax error in vcalendar tpl file.
-- Issue #1103032, Add plain date formatter and set it to be the default token formatter.
-- Issue #1177684 by tim.plunket, Fix typo in last commit.
-- Issue #1177684, Wrong translation of short month name.
-- Issue #1201342 by colinlee and alexprv, Comment out SQLSVR timezone adjustment until it gets fixed properly.
-- Issue #1308274 by sneyerst, SQL Server DATEPART function cannot accept composed datetime formats.
-- Issue #1308266 by sneyerst, Fix arithmetic overflow in SQLSVR.
-- Issue #1333104 by tim.plunkett, Check that $field['settings'] exists in date_is_repeat_field().
-- Error message for years back and forward doesn't match new labels, should be Starting year and Ending year.
-- Issue #1179715, Switch drupal_array_get_nested_value() to use 'values' instead of 'input', where it makes sense, and simplify some of this code.
-- Issue #1179715, Create a helper function for testing hidden/disabled dates and test each date element and validator to skip processing in that case.
-- Issue #1179715, When hidden by #access=FALSE, repeating date fields were getting removed and not replaced.
-- Issue #1179715, By pass date repeat widget processing and validation when element is hidden from user.
-- Issue #1179715, Don't do timezone adjustments in the widget, wait for #process so we can skip it when the date field has been hidden by #access.
-- Issue #1338194, Logic for creating end date wasn't taking into account the possibility that a field might have no value2.
-- Issue #1179715, Default value callback for the timezone widget was not returning an array.
-- Issue #1179716, Remove value_callback for date_repeat and date_combo forms, the default behavior works fine.
-- Issue #1178716 by das-peter, Use drupal_array_get_nested_value() in Date Repeat instead of trying to find it manually.
-- Issue #1178716 by das-peter and KarenS, Tweak the date repeat widget to identify empty input when used on nodes with translation.
-- Issue #1178716 by das-peter and KarenS, Fix date repeat form values that are not arrays when hidden on a node that has translation.
-- Issue #1178176 by das-peter, Fix date_combo_value_callback to return NULL to avoid data lost on untranslatable dates used with Entity Translation.
-- Date Context module was making incorrect assumptions about the $language of the field.
-- Issue #1237974, Schema module wants the datetime column to be lower case.
-- Issue #1233084, fix a few places that were wrapping $instance['label'] with t().
-- Issue #1188380 by Xen and jherencia, use #title instead of field['label'] in date display because that has the i18n translation.
-- Issue #1330768 by das-peter, remove whitespace.
-- Tweak date_pager_url to allow a way to create non-absolute urls.
-- Make sure deleted displays won't create errors in Views by returning FALSE in date_forbid() if there is no date argument.
-- Issue #1257830, Beef up the logic when creating the date repeat tabs to work for more kinds of entities.
-- Issue #1260962, Repeating date fields should save the date even if there is no repeat information.
-- Issue #1241836 by kzoli, Fix undefined cardinality indexes.
-- Issue #1233722, Fix undefined index notice in pager when other filters are used.
-
-======================
-Version 7.x-2.0-alpha4
-======================
-
+By KarenS: Fix to new default date handling, the default date has to set a date
+  in the database timezone, not the display timezone.
+#1245106 by Gábor Hojtsy, Hide the option to add the delta into the view for
+  single value fields.
+#1370876 by KarenS: Make sure new Date All Day code does not try to set the
+  popup values if Date Popup is disabled.
+#874322 by KarenS: Add back the date_field_all_day() function to avoid breaking
+  other modules that are using it.
+By KarenS: Fix Date text placeholder to display a formatted date instead of a
+  format. Follow up to Date repeat UI changes.
+#1248520 by fearlsgroove, Use attribute selector on all day and end day
+  checkboxes.
+#952446 and #1031690 by KarenS: Select dates with only year and month were not
+  working.
+#1292152 by pfrenssen, Remove debug functions.
+#1338976 by Josh Benner, Adjust iCal unwrap to allow for leading spaces, per
+  standard.
+#1352486 by d.novikov, Rework date SQL formatting for Microsoft SQL.
+#1266536 by KarenS: Keep timezone adjustments from altering the values for
+  repeating date EXCEPTIONS and ADDITIONS.
+#1353488 by KarenS: Some repeating date calculations using PHP 5.3.6+ were not
+  computing correctly.
+#1364026 by KarenS: Fix link to documentation, also move help to Date API
+  module.
+#1276270 by KarenS: Fix fatal error when using repeat date on user.
+#1362758 by KarenS: Add empty file for the date_plugin_display_attachment.inc
+  file that was removed, to avoid fatal errors if it is missing on a site that
+  formerly used it.
+#1363460 by KarenS: Make sure widget dates do not end up with the current date
+  when they should be empty.
+#1353488 by KarenS: Attempt to fix problem using date_date_set() in PHP 5.3.6+.
+By KarenS: Date Migrate tests needed some fixes to conform to latest code.
+#1353790 by KarenS: Hide missing index notice if the value in the Date Popup
+  does not match the expected value, it will still get trapped as a validation
+  error.
+#1353790 by KarenS: Make sure Date Popup properly translates the default value
+  if it includes month or day names.
+#1217796 by KarenS: Make sure that All Day formatting works correctly even if
+  the All Day label is empty.
+By KarenS: The repeat description was lost by a recent change to the theme that
+  sent the element through the theme twice.
+By KarenS: Remove date_get_nested_elements() function. Not being used and I
+  don't want other code to start expecting it.
+#1266144 by KarenS: The end date should get set to blank if it is optional and
+  matches the start date, but only if it is not populated by default values.
+#1349510 by KarenS: Make sure default values get populated before processing so
+  they still get set on hidden fields.
+
+
+Date 7.x-2.0-alpha5, 2011-11-29
+-------------------------------
+The date repeat widgets have been removed to keep users from trying to change
+repeating dates into non-repeating dates. There are now just three widgets, Date
+Select, Date Text, and Date Popup. Whether or not a date is a repeating date is
+now controlled by a field setting.
+
+New Features/UX Changes/API Changes:
+#1304056 by DamienMcKenna: Add option to date_difference to indicate direction
+  of difference.
+#1238660 by KarenS: Add custom format option for the date format used in summary
+  arguments.
+#1038482 by somanyfish, iCal import failing due to colon instead of semi-colon.
+#1252952 by eosrei: Make "all day" checkbox configurable on a per field instance
+  basis.
+#1266144 by arlinsandbulte: Clarify Default End Date Setting.
+#1261478 by stevector and KarenS, Reconfigure the back/next buttons into item
+  lists so Views ajax pager works right.
+#1262960 by KarenS: Add a new module to work with the Context module to set a
+  condition based on the value of a date field.
+#1216878 by KarenS: Re-introduce 'repeat' as a field setting rather than a
+  widget type so people can't try to switch back and forth between repeating and
+  non-repeating dates. Eliminate repeat widgets.
+
+Bugfixes:
+#1280658 and follow up to Issue #1238660 by KarenS, tockliasteroid: Rework the
+  format control over the summary title and apply it to the title() callback.
+#1276622 by ArtistConk: Make sure Except date contains no default value.
+#1153766 by fago: More work on the entity property setters and getters.
+#1331214 by KarenS: Make sure Date Migrate properly handles empty date values.
+#1285224 by KarenS: Make sure Date Migrate works for importing repeating dates
+  now that widgets have changed.
+#1162290 by KarenS: Make sure date for example formats avoids confusing short
+  and long month names.
+By KarenS: Re-organize handling of custom date formats.
+#1122038 by KarenS: Make sure empty values are not passed to Views to be themed
+  for repeating dates.
+#1101284 by pfournier: Expand regex for Month names to catch more possible
+  variations.
+#1343406 by slashrsm: Add back the caching of the views fields list.
+#1302374 by miro_dietiker: Account for an inconsistency in core handling of
+  non-existant date formats.
+#1344014 by James Sharpe: Get rid of 'Repeats every 0 days' description.
+#1302212 by KarenS: Change the way default dates using custom code are created.
+#1292898 by KarenS: Check for all day checkbox in the basic date element
+  validation so empty time for newly added elements still passes validation.
+#1252952 by KarenS: Follow up, Move checkbox setting to the same spot where time
+  is set, and don't show option on dates without time.
+#1335818 by joelpitter: Don't create a date for empty values in the date getters
+  and setters.
+#1271726 by KarenS: Keep default_value out of exposed form so it won't show up
+  in pager.
+#1017866 by KarenS: Fix miscellaneous problems where filter/argument incorrectly
+  do timezone adjustment.
+#1103032 by KarenS: Attempt to add setters to date entity metadata so Rules can
+  use them.
+#1153766 by KarenS: Adapt metadata functions to the pattern in the current
+  Entity code, add $info to the getters.
+#1278876 by basicmagic.net: Typo in date.css.
+#752550 by Fonant: Week number gets printed twice.
+#1052586 by jpsolero: Problem with Date API when using Calendar with argument
+  set to "Week" granularity and "current date" default argument
+#1266144 by KarenS: End date same as start date default not being respected.
+#1239934 by casey: Fix javascript exception in date_year_range.js.
+#1310558 by KarenS: Don't show extra label on exposed date filter.
+By KarenS: Fix bug in Date Popup that still uses the current date when the
+  default date is empty.
+#1335578 by aaronbauman: Make it possible to pass in +/- 1000 years to years
+  back/forward.
+#1292516 by mcarbone: Fix Uninitialized string offset in Date Migrate.
+#1084980 by jwilson3: Set default value for $granularity to be array in
+  date_formatter_format.
+#1227350 by grendzy: Summary view should not be calling date_forbid().
+#1286570 by KarenS: Fix undefined index error caused by using a remember value
+  without checking if it exists.
+#1337440 by phoenix: Fix syntax error in vcalendar tpl file.
+#1103032 by KarenS: Add plain date formatter and set it to be the default token
+  formatter.
+#1177684 by tim.plunket: Fix typo in last commit.
+#1177684 by KarenS: Wrong translation of short month name.
+#1201342 by colinlee, alexprv: Comment out SQLSVR timezone adjustment until it
+  gets fixed properly.
+#1308274 by sneyerst: SQL Server DATEPART function cannot accept composed
+  datetime formats.
+#1308266 by sneyerst: Fix arithmetic overflow in SQLSVR.
+#1333104 by tim.plunkett: Check that $field['settings'] exists in
+  date_is_repeat_field().
+By KarenS: Error message for years back and forward doesn't match new labels,
+  should be Starting year and Ending year.
+#1179715 by KarenS: Switch drupal_array_get_nested_value() to use 'values'
+  instead of 'input', where it makes sense, and simplify some of this code.
+#1179715 by KarenS: Create a helper function for testing hidden/disabled dates
+  and test each date element and validator to skip processing in that case.
+#1179715 by KarenS: When hidden by #access=FALSE, repeating date fields were
+  getting removed and not replaced.
+#1179715 by KarenS: By pass date repeat widget processing and validation when
+  element is hidden from user.
+#1179715 by KarenS: Don't do timezone adjustments in the widget, wait for
+  #process so we can skip it when the date field has been hidden by #access.
+#1338194 by KarenS: Logic for creating end date wasn't taking into account the
+  possibility that a field might have no value2.
+#1179715 by KarenS: Default value callback for the timezone widget was not
+  returning an array.
+#1179716 by KarenS: Remove value_callback for date_repeat and date_combo forms,
+  the default behavior works fine.
+#1178716 by das-peter: Use drupal_array_get_nested_value() in Date Repeat
+  instead of trying to find it manually.
+#1178716 by das-peter, KarenS: Tweak the date repeat widget to identify empty
+  input when used on nodes with translation.
+#1178716 by das-peter, KarenS: Fix date repeat form values that are not arrays
+  when hidden on a node that has translation.
+#1178176 by das-peter: Fix date_combo_value_callback to return NULL to avoid
+  data lost on untranslatable dates used with Entity Translation.
+By KarenS: Date Context module was making incorrect assumptions about the
+  $language of the field.
+#1237974 by KarenS: Schema module wants the datetime column to be lower case.
+#1233084 by KarenS: fix a few places that were wrapping $instance['label'] with
+  t().
+#1188380 by Xen, jherencia: use #title instead of field['label'] in date display
+  because that has the i18n translation.
+#1330768 by das-peter: remove whitespace.
+By KarenS: Tweak date_pager_url to allow a way to create non-absolute urls.
+By KarenS: Make sure deleted displays won't create errors in Views by returning
+  FALSE in date_forbid() if there is no date argument.
+#1257830 by KarenS: Beef up the logic when creating the date repeat tabs to work
+  for more kinds of entities.
+#1260962 by KarenS: Repeating date fields should save the date even if there is
+  no repeat information.
+#1241836 by kzoli: Fix undefined cardinality indexes.
+#1233722 by KarenS: Fix undefined index notice in pager when other filters are
+  used.
+
+
+Date 7.x-2.0-alpha4, 2011-08-23
+-------------------------------
 Notes to themers:
-
-Previous versions put dates with both From and To dates into a fieldset and other dates were not.
-The new code adds additional floating elements that are hard to contain, so now all dates are
-enclosed in fieldsets in the node form. There are also new elements on the form, an optional
-checkbox for hiding/showing the To date and an optional checkbox for hiding/showing time.
-Previously dates on the node form had 'From date' and 'To date' labels above them, this
-has been changed to remove those labels, using the Google calendar date entry screen
-as a model. This simplifies the node form and dates take up less space. A light grey border
-has been added around each collection of dates (the From date and the To date). The display
-of labels above the date parts (year, month, day, date, time, etc) is controlled in the
-field settings. Previous versions did not always honor those settings, this one does.
-
-New Features/UX Improvements
-
-- 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.
-- Issue #334435, Add a theme function for the 'Date' and 'Time' labels in the Popup widget.
-- Issue #1239956 by David_Rothstein, Change the default separation between from and to dates to use 'to' instead of a hyphen.
-- Issue #1240628 by David_Rothstein, Make the date increment default to 15 instead of 1.
-- 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 #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'.
-- Issue #1233948 by KarenS, Add 'All Day' checkbox to hide/show the time parts of the date form. If All day is chosen, any time is replaced with 00:00:00 when the form is submitted.
-- Issue #1233612 by KarenS, Add 'Collect end date' checkbox for dates with optional end dates to hide/show the end date.
-- Issue #821200 by scor and KarenS, Add RDF support to the date field.
-- Issue #1211744 by EclipseGC and KarenS, Add a Date pager plugin that is designed to add paging in conjunction with a Date argument.
-- Issue #1180612 by mikeryan, Add support for Migrate module.
-- Issue #1198320 by ksenzee, David_Rothstein, Noyz: Make UI improvements to field settings page.
-- Issue #1215738 by ksenzee, Make granularity settings checkboxes horizontal.
-- Issue #1215686 by ksenzee, Change name of date field types to be more intuitive.
-- Issue #1216996 by ksenzee, Change the years back/forward setting into two drop down boxes.
-- Issue #1222468 by ksenzee, Hide timezone options when using granularity without time.
-- Issue #1229388 by ksenzee, Hide formatter from/to choices on fields without multiple values.
-
-Removed deprecated functions
-
-- Removed date_handler_fields(), only applicable to D6 code.
-- Removed date_views_real_url() and date_views_page_url(), used by older calendar version.
-- Remove unused date_handler_field_multiple.
-
-Tests
-
-- Issue #1251592 by David_Rothstein, Set reasonable default values if date formats have not been configured, and add tests for that.
-- Issue #1242764 Add tests for every possible combination of field type, timezone handling, and granularity.
-- More work on tests, add a foreach loop to run through all field_type/widget_type combinations.
-- Rework tests to use a base class rather than copying the same functions everywhere.
-- Issue #1209408 Make sure date_repeat_calc() returns empty array for FREQ=NONE and INTERVAL=0, also add a test for that.
-- Issue #1161006 by justinrandall, Add tests to check that dates that should have time but do not are correctly caught in validation.
-
-Bugfixes
-
-- Issue #1256406 by q0rban, use variable_get() in hook_requirments().
-- Follow up to Issue #1145976, Make sure 'is date' only gets applied to the date values, not delta, timezone, etc.
-- Issue #1238364, Make sure the Date pager doesn't throw errors if the default date is missing.
-- Issue #1246416, Add info to the Date Popup README.txt about how to download the WVega timepicker.
-- Issue #1253230, Package name of Date Migrate was different than the other Date components.
-- Issue #1251592, Add installation message and system requirements warnings about missing system date settings.
-- Issue #1250784, Don't save psuedo field settings created by the new UI in the field itself.
-- Issue #1239228 by David_Rothstein, Always add Date Views css to View UI edit forms.
-- Issue #1254540 by David_Rothstein, Move borders off of the wrappers so they don't appear when the dates inside them are hidden.
-- Issue #1253248 by David_Rothstein, Move RDF attributes handling to preprocess function.
-- Issue #1087798 by anj, Fix X-WR-CALNAME in VCALENDAR.
-- 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 #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 #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.
-- Issue #1236192 by loganfsmyth, Make sure #date_label_position has a default value in the Date Popup module.
-- 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 #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.
-- Follow up to Issue #1239956, Fix tests broken by change in date separator.
-- Issue #1241576, Fix date combo validation for all-day dates so they don't fail validation because the format is unexpected.
-- Take the guesswork out of examining Date info for Views, add is_field flag.
-- Follow up to Issue #874322, Date popup field needs to accept date without time for the all day flag to work.
-- Follow up to Issue #1130814, It looks like the modification is not needed in date_repeat_set_month_day and date_repeat_set_year_day.
-- Issue #1160132 by seanbfuller and KarenS, Exposed filter widgets were not displaying the default values.
-- Adjust the way widgets are styled in Views exposed filters after the latest style changes for form elements.
-- Issue #1234114 by arlinsandbulte, Add more space between checkboxes.
-- Issue #1234090, Fix undefined variable 'all_day'.
-- Issue #1232570 by dboulet, Remove some unneeded duplication of core clearfix and other css cleanup.
-- Issue #1232614 by dboulet, Date css should not be setting font family.
-- Timezone and Date Popup weren't obeying the settings for displaying the date part label.
-- Issue #1130814 by cdracars, mikeryan, mayobutter, Fix date_modify difference between PHP 5.3.5 and 5.3.6 so both work to compute repeating dates.
-- Issue #1017866 by KarenS and Jason89s, Make sure views argument and filter don't do timezone adjustment for dates that don't have time.
-- Issue #1204988 by paulsheldrake, Remove IE6 code from datepicker CSS.
-- Issue #1231864 by Damien McKenna, Clean up line endings in vevent and vcalendar tpl files.
-- Issue #1231382 by dboulet, Clean up date css, code style fixes.
-- Date repeat additions and exceptions need to be reworked into full, timezone-adjusted, datetime values when passing them to FAPI as default values.
-- Issue #1223034 by c4rl, Make sure repeating date additions and exceptions work correctly when there is more than one repeating date in the same form.
-- Issue #1229362, Date Popup module needs date_is_date() function, which should not require Date module. Move that to Date API.
-- Issue #1227208 by ksenzee, Minor text changes.
-- Issue #1094408, Change method of identifying Field module filters, using the name of the group is not robust enough.
-- Issue #1227264 by gapa, Fix wrong class in date-pager.tpl.php.
-- Issue #1207540, Summary grouping won't work right unless the formula alias doesn't match an actual field value.
-- Issue #1227350 Summary query still needs the formula, add it back.
-- Fix 'variables cannot be passed by reference' notice on repeats page.
-- Issue #1222736 Fix export errors caused when previous export fix of using export plugins got broken by changes in Views.
-- Issue #1077490 Fix notices about missing #date_flexible.
-- Move the 'top' date pager to below the header instead of below attachment_before so you can add header text above it.
-- The value for variable_get('date_first_day') should default to zero to match core default.
-- Issue #1147620 by KarenS with an assist from tim.plunkett, Fix the query so it will locate dates that span days or months by checking the intersection of the date range and the query range. Also add an option to the argument so you can do a simple query for either the from or to date when checking the whole range isn't the right solution.
-- Issue #307274 by ksenzee, Fix broken validation for absolute value in years back/forward.
-- Issue #1173374 by fietserwin, Remove translation of the jQuery datepicker day and month names, now handled by core.
-- Issue #1192020 by tim.plunkett: Fixed date granularity is too fragile in date_field_all_day().
-- Issue #1110012 Remove 'parent' items from Views plugins, no longer needed? See if this fixes the issue.
-- Issue #1183892, Initialize $identifier in date_views_filter_handler_simple.
-- Issue #1103290 by stickywes and ingaro, Change postgres 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS' to 'FMYYYY-FMMM-FMDDTFMHH24:FMMI:FMSS'.
-- Issue #1186528 by jox, Make date field combo label translatable.
-- Issue #1123186 by KingJoshi, Fix misnamed date_part_hour_prefix in hook_theme().
-- Issue #1032942 by fietserwin, Rename date popup functions that are getting picked up by theme('date').
-- Issue #1206756 More tweaks to the validation changes. They were blocking zero times and causing some test failures.
-- Issue #1197352 Don't display language about from and to dates when there is no todate.
-- Issue #1201288 by rafa0961, fix broken references to SQLSERVER.
-- More work on cleaning up validation, add in some ideas from fearlsgrove about checking the granularity of the input array against the expected granularity.
-- Issue #1161006 Dates that should have time but do not were not correctly caught in validation.
-- Get rid of overlapping formatter functionality. There should be a default formatter with the option to choose a date format as a setting, not a formatter for each format. This was a leftover from the D6 functionality.
-- Issue #1159404 by mikeryan, Fix incorrect call to parse an rrule in date_repeat_build_dates().
-- Issue #1160656 by jjs, Replace missing break in date_api.sql.inc that breaks PostgreSQL.
-- Issue #1150454, Fix undefined index notices for repeat_collapsed value.
-- Issue #1150462, Put length limit on content type names created by Date Tools so block delta won't overflow the allowed size.
-- Issue #1136734, When migrating date format data from D6 to D7, don't try to overwrite existing custom values.
-- Issue #1161042 by Ollie222, Date filters using time were inconsistently formatted.
-- Issue #1130884, Bad logic in 'between' filter SQL, should always join with AND.
-- Issue #1139418 by ankur, Bad logic in week argument SQL, should always join with AND.
-- Issue #1118356, Disabling the Timepicker was having no effect.
-- Issue #408770 by vkareh, Make sure dates with #access = FALSE get passed through date_combo_element_process().
-- Issue #1037174 by das-peter, add ajax support to date popup.
-- Issue #1160614 by joelstein, Make sure date repeat rule gets split correctly no matter which line endings were used.
-- Issue #1110708 by mr.baileys, Fix problem combining date filter with other exposed filters.
-- Switch some references to $node to use $entity instead.
-- Issue #1112206, add a dummy field to the date navigation bar query to keep it from trying to create invalid sql.
-- Issue #1112206, $this->view->query->clear_fields() is still need for date_browser to keep Views from trying to use missing field values.
-- Date browser only works with date_argument, should work with any argument derived from date.
-
-======================
-Version 7.x-2.0-alpha3
-======================
-
-- Issue #1138700, missed a couple references to the construct() function.
-
-======================
-Version 7.x-2.0-alpha2
-======================
-
-- Follow up to Issue #1103290, constructor was not set up correctly and did not get triggered, so none of the date handlers had a db_type.
-- Issue #1138622, preliminary pass at adding support for SQL Server.
-- Issue #1136618 by ksenzee, Fix broken hide/show capability for date filter values.
-- Issue #1059078 Add preliminary support for SQLite dates.
-- Issue #1103290 by kevintheday, Use db_driver() to determine database engine.
-- The 'now' values got broken again somewhere along the line. Now we need to switch the ISO format used by our SQL queries back to the datetime format the widgets use.
-- Looks like Views changed ['expose']['operator'] to ['expose']['operator_id'].
-- Issue #1115770, Make sure filters values are switched back to ISO format so time comparisons work correctly.
-- Issue #1132916 by znerol, Fix a couple more usages of date_default_timezone_name().
-- Issue #1131308 Don't try to do timzone conversion when there is no localzone for a field.
-- Issue #1093222 Fix broken function to remove calendar views.
-- Issue #820670 Add update to move D6 date format data to D7 data.
-- Issue 1074344 Fix problem with date select widget that keeps resetting pm back to am.
-- Issue #1001186 Make sure that a 2 digit year is flagged as an error.
-- Issue #1117420 by threewestwinds, Make timepicker formats more useful.
-- Issue #1126408 by thekevinday, Add more sql formats to date api.
-- Issue #1129326 by robertom, add missing  value to element in date_combo.
-- Issue #998220 by jamsilver and yched, fix handling of validation in date_combo. This also fixes errors when using a date in Profile 2 and Field Collections.
-- Issue #1022592 by andypost and tim.plunkett optimize hook_form_alter into hook_form FORMID_alter.
-- Issue 1021424 by joostvdl and wiizzard, fix context in translations to use core values.
-- Remove extra fields from the Date field. I think the filter and argument now get the right tables joined in without that. We still need the extra fields on calendar, but now we will only add them in the calendar view.
-- Fix some notices in vcalendar theme.
-- Fix the mini calendar querystring.
-- Fix logic for day argument formula.
-- Fix logic for week argument formula.
-- Issue #1086582 by bojanz, summary options are in a different place now, fix the method of removing the summary option on multiple-date arguments.
-- Views renamed 'wildcard' to 'exception'.
-- Apparently the handler->argument value is not always populated.
-- Fix fallback value for date_group.
-- Issue #1103032 by tim.plunkett, Remove token integration code until Token module is fixed.
-- Now that there is no group of 'Fields' we need different tests to tell if this is a field filter.
-- Views changed the group name of fields from 'Fields' to 'Content'. Blech, broke everything.
-- Fix potential error if handler is broken.
-- Remove reference to a function that no longer exists in Views.
-- Issue #1116962 by jpontani, mordonez: Parse Error - date_views_fields.inc on line 119.
-- Fix the logic for year and month only dates.
-- Add helper function to test if handler is a date handler.
-- Fix broken handling when creating dates from timestamps.
-- Set some defaults for dates without month or day.
-- Issue ##1094408 by Boobaa: Date field not showing up in views arguments in localized site
-- Issue #1018412 by omerida: get_class() called without object.
-- There were some problems when creating a year-only date using the select filter caused by trying to create a date with zeros in the month and day. Fix the date building logic to force a valid month and day into them.
-- Complex filters were not using the date handler of the individual fields.
-- Issue #1100934, Replace deprecated date_array() function.
-- #1096246 Date argument also was not applying the group method in the right place in the query, causing that method to be applied to all filters.
-- Missed a couple places when re-naming the get_value() function in the filter.
-- Fix more notices.
-- #1096246 Date filter was not apply the group method in the right place in the query, causing that method to be applied to all filters.
-- Fix undefined index notice.
-- Remove non-used function.
-- Issue #1082654 by arlinsandbulte: Remove master branch files and explain in readme.txt
-- Issue #906622 by bfroehle, Start cleanup of Date token code.
-- Fix typo in form processing.
-- Clean up the admin summary for the date filter.
-- Fix another use of get_value() in the filter.
-- Fix some strict errors in the views filter.
-- #1094408 by Boobaa: Date field not showing up in views arguments in localized site
-- #1041428, by tim.plunkett: Fix logic errors in 'All Day' computations.
-- #1054458: Move date_increment_round() function into Date API module so it is always available.
-- #745074, by rsevero:  Don't test for valid timezone-adjusted date for dates that don't use time.
-- #1076992: The timezone element never got completely updated to D7.
-- #1013662 by developer-x: Remove check for start and end date - this prevented multiday-all day events from showing 'All Day'
-
-======================
-Version 7.x-2.0-alpha1
-======================
-
-- #1082658: Saving the options as arrays breaks other things. Add a custom export plugin instead.
-- #1082658, Views options need to be declared as arrays or they are not saved in the export in Views 3.
-- #1075896 Break out the code into the simple argument and a complex argument that combines date fields.
-- #1075890 Break out the code into the simple filter and a complex filter that combines date fields.
-
-======================
-Version 7.x-1.0-dev
-======================
-
-Abandoned the 7.x-1.x branch.
-
-Start a new 7.x-2.x branch that will contain a complete re-work of the Views handling.
-
-The 7.x-2.x branch will totally re-work and simplify the Views filters. These changes may/will
-break some views and will require that you check views that use the date filter or
-argument to be sure they are still configured correctly.
-
-There is a new date_filter_handler_simple for an individual date field that simplifies
-the Views handling by using most of the core Views field handling but adds in the
-possibility to set a default date using options like 'now', along with a choice of a
-month/day/year drop-down selector or popup calendar selector.
-
-The date_filter_handler is an extension of the simple handler that allows you to combine
-multiple dates into a single filter so that you can control all of them with the same
-filter widget, allowing you to either 'OR' or 'AND' them together.
-
-The arguments will be rewritten in the same way, with a simple argument handler for
-individual dates and another handler that extends that to control multiple dates with
-a single argument.
-
-- Add some error trapping in case the parent dateObject is unable to make a date out of a string to avoid showing the user errors.
-- #1027752 by B-Prod and dboulet, Fix missing table join on argument summary view.
-- #1047412 by das-peter - Using date filter in February causes "The day is invalid" error.
-- #1014162 Now that the datefield processing expands to date & time, the form_value is corrupted.
-- Changes to the data migration code to work with latest iteration of Content Migrate.
-
-======================
-Version 7.x-1.0-alpha2
-======================
-
-- Views made lots of changes to field handling just before the new release, which broke lots of things here.
-- Adding some work-arounds to get things working again and waiting until the dust settles on how the new core fields will be handled in Views before doing much more with the Views integration. These changes should get things working with latest Views release.
-
-======================
-Version 7.x-1.0-alpha1
-======================
-
-- Initial release, probably still buggy.
-- Remove Date PHP4, no longer needed because PHP4 is not supported any more.
-- Remove Date Timezone, now handled by core.
+Previous versions put dates with both From and To dates into a fieldset and
+other dates were not. The new code adds additional floating elements that are
+hard to contain, so now all dates are enclosed in fieldsets in the node form.
+There are also new elements on the form, an optional checkbox for hiding/showing
+the To date and an optional checkbox for hiding/showing time. Previously dates
+on the node form had 'From date' and 'To date' labels above them, this has been
+changed to remove those labels, using the Google calendar date entry screen as a
+model. This simplifies the node form and dates take up less space. A light grey
+border has been added around each collection of dates (the From date and the To
+date). The display of labels above the date parts (year, month, day, date, time,
+etc) is controlled in the field settings. Previous versions did not always honor
+those settings, this one does.
+
+New Features/UX Improvements:
+#1249724 by KarenS, Gábor Hojtsy, David_Rothstein: Improve usability of date and
+  time input configuration.
+#1250784 by David_Rothstein: Add user-friendly labels for start and end date
+  values in Views.
+#742146 by KarenS: Add option to remove X-WR-CALNAME if VEVENT is not a feed.
+By KarenS: Add option to change method from PUBLISH to REQUEST in VCALENDAR.
+#334435 by KarenS: Add a theme function for the 'Date' and 'Time' labels in the
+  Popup widget.
+#1239956 by David_Rothstein: Change the default separation between from and t
+  dates to use 'to' instead of a hyphen.
+#1240628 by David_Rothstein: Make the date increment default to 15 instead of 1.
+#1249724 by David_Rothstein: Improve usability of date and time input
+  configuration.
+#1177198 by tim.plunkett: Allow CTools to process #dependency for date elements.
+#1245562 by David_Rothstein: Rename the default date display format to something
+  friendlier
+#1239934 by David_Rothstein, Gábor Hojtsy: Reuse the "years back and forward"
+  dropdown widget on the Views filter settings page.
+#1239228 by Gábor Hojtsy: Date Views filter form UI improvements, clarify the
+  way absolute and relative dates work.
+#233047 by ksenzee, David_Rothstein: Add the Vegas jQuery timepicker as a new
+  time selector option.
+#1145976 by tim.plunkett, KarenS: Add 'is date' identifier to all date handlers.
+#1234140 by arlinsundbulte: Change terminology in user-facing text from 'From/To
+  Date' to 'Start/End Date'.
+#1233948 by KarenS: Add 'All Day' checkbox to hide/show the time parts of the
+  date form. If All day is chosen, any time is replaced with 00:00:00 when the
+  form is submitted.
+#1233612 by KarenS: Add 'Collect end date' checkbox for dates with optional end
+  dates to hide/show the end date.
+#821200 by scor, KarenS: Add RDF support to the date field.
+#1211744 by EclipseGC, KarenS: Add a Date pager plugin that is designed to add
+  paging in conjunction with a Date argument.
+#1180612 by mikeryan: Add support for Migrate module.
+#1198320 by ksenzee: David_Rothstein, Noyz: Make UI improvements to field
+  settings page.
+#1215738 by ksenzee: Make granularity settings checkboxes horizontal.
+#1215686 by ksenzee: Change name of date field types to be more intuitive.
+#1216996 by ksenzee: Change the years back/forward setting into two drop down
+  boxes.
+#1222468 by ksenzee: Hide timezone options when using granularity without time.
+#1229388 by ksenzee: Hide formatter from/to choices on fields without multiple
+  values.
+
+Removed deprecated functions:
+By KarenS: Removed date_handler_fields(), only applicable to D6 code.
+By KarenS: Removed date_views_real_url() and date_views_page_url(), used by
+  older calendar version.
+By KarenS: Remove unused date_handler_field_multiple.
+
+Tests:
+#1251592 by David_Rothstein: Set reasonable default values if date formats have
+  not been configured, and add tests for that.
+#1242764 by KarenS: Add tests for every possible combination of field type,
+  timezone handling, and granularity.
+By KarenS: More work on tests, add a foreach loop to run through all field_type
+  /widget_type combinations.
+By KarenS: Rework tests to use a base class rather than copying the same
+  functions everywhere.
+#1209408 by KarenS: Make sure date_repeat_calc() returns empty array for
+  FREQ=NONE and INTERVAL=0, also add a test for that.
+#1161006 by justinrandall: Add tests to check that dates that should have time
+  but do not are correctly caught in validation.
+
+Bugfixes:
+#1256406 by q0rban: use variable_get() in hook_requirments().
+By KarenS: Follow up to Issue #1145976, Make sure 'is date' only gets applied to
+  the date values, not delta, timezone, etc.
+#1238364 by KarenS: Make sure the Date pager doesn't throw errors if the default
+  date is missing.
+#1246416 by KarenS: Add info to the Date Popup README.txt about how to download
+  the WVega timepicker.
+#1253230 by KarenS: Package name of Date Migrate was different than the other
+  Date components.
+#1251592 by KarenS: Add installation message and system requirements warnings
+  about missing system date settings.
+#1250784 by KarenS: Don't save psuedo field settings created by the new UI in
+  the field itself.
+#1239228 by David_Rothstein: Always add Date Views css to View UI edit forms.
+#1254540 by David_Rothstein: Move borders off of the wrappers so they don't
+  appear when the dates inside them are hidden.
+#1253248 by David_Rothstein: Move RDF attribute handling to preprocess function.
+#1087798 by anj: Fix X-WR-CALNAME in VCALENDAR.
+#1254582 by KarenS: Repeat additions need to be adjusted to use the same time as
+  the original date.
+By KarenS: Move vcalendar and vevent templates from Date Views to Date API
+  modules.
+By KarenS: Follow up to Issue #1250344, We don't need extra space when there is
+  a description, only when there is not.
+#1239228 by Gábor Hojtsy: More tweaks to filter css.
+#1244924 by Gábor Hojtsy: Minor text improvements in date filter configuration.
+#1245556 by David_Rothstein: Date granularity description incorrectly implies
+  that it affects the date attributes that are displayed
+#1247444 by Gábor Hojtsy: Give a little breathing space to the date year range
+  "other" field
+#1250344 by jessebeach: Fix padding around date fields by adding clearfix class.
+#1249116 by yched: Fix various glitches with D6 migration code.
+#1243022 by fmosca, KarenS: Make sure all_day #states visibility is only set
+  when there is a value for all_day.
+#1236192 by loganfsmyth: Make sure #date_label_position has a default value in
+  the Date Popup module.
+#1246416 by KarenS: Test whether libraries_get_path() returns a valid path
+  before using it.
+#1235994 by KarenS: Don't display 'All Day' when using a format that has no
+  time.
+#1245690 by mikeryan: Migration plugin missing seconds from date formats.
+#1229406 by David Rothstein, Gábor Hojtsy, tim.plunkett: Fix broken timepicker
+  in Chrome and Safari.
+#1239412 by keithm: Fix validation error when #access is false.
+#1232522 by KarenS: Don't alter field_ui_field_edit form except on date fields.
+#1243842 by KarenS: Make sure the All Day and Show End Date flags work correctly
+  in unlimited value fields that use ajax.
+By KarenS: Follow up to Issue #1239956, Fix tests broken by change in date
+  separator.
+#1241576 by KarenS: Fix date combo validation for all-day dates so they don't
+  fail validation because the format is unexpected.
+By KarenS: Take the guesswork out of examining Date info for Views, add is_field
+  flag.
+By KarenS: Follow up to Issue #874322, Date popup field needs to accept date
+  without time for the all day flag to work.
+By KarenS: Follow up to Issue #1130814, It looks like the modification is not
+  needed in date_repeat_set_month_day and date_repeat_set_year_day.
+#1160132 by seanbfuller, KarenS: Exposed filter widgets were not displaying the
+  default values.
+By KarenS: Adjust the way widgets are styled in Views exposed filters after the
+  latest style changes for form elements.
+#1234114 by arlinsandbulte: Add more space between checkboxes.
+#1234090 by KarenS: Fix undefined variable 'all_day'.
+#1232570 by dboulet: Remove some unneeded duplication of core clearfix and other
+  css cleanup.
+#1232614 by dboulet: Date css should not be setting font family.
+By KarenS: Timezone and Date Popup weren't obeying the settings for displaying
+  the date part label.
+#1130814 by cdracars, mikeryan, mayobutter: Fix date_modify difference between
+  PHP 5.3.5 and 5.3.6 so both work to compute repeating dates.
+#1017866 by KarenS, Jason89s: Make sure views argument and filter don't do
+  timezone adjustment for dates that don't have time.
+#1204988 by paulsheldrake: Remove IE6 code from datepicker CSS.
+#1231864 by Damien McKenna: Clean up line endings in vevent and vcalendar tpl
+  files.
+#1231382 by dboulet: Clean up date css, code style fixes.
+By KarenS: Date repeat additions and exceptions need to be reworked into full,
+  timezone-adjusted, datetime values when passing them to FAPI as default
+    values.
+#1223034 by c4rl: Make sure repeating date additions and exceptions work
+  correctly when there is more than one repeating date in the same form.
+#1229362 by KarenS: Date Popup module needs date_is_date() function, which
+  should not require Date module. Move that to Date API.
+#1227208 by ksenzee: Minor text changes.
+#1094408 by KarenS: Change method of identifying Field module filters, using the
+  name of the group is not robust enough.
+#1227264 by gapa: Fix wrong class in date-pager.tpl.php.
+#1207540 by KarenS: Summary grouping won't work right unless the formula alias
+  doesn't match an actual field value.
+#1227350 by KarenS: Summary query still needs the formula, add it back.
+By KarenS: Fix 'variables cannot be passed by reference' notice on repeats page.
+#1222736 by KarenS: Fix export errors caused when previous export fix of using
+  export plugins got broken by changes in Views.
+#1077490 by KarenS: Fix notices about missing #date_flexible.
+By KarenS: Move the 'top' date pager to below the header instead of below
+  attachment_before so you can add header text above it.
+By KarenS: The value for variable_get('date_first_day') should default to zero
+  to match core default.
+#1147620 by KarenS: With an assist from tim.plunkett, Fix the query so it will
+  locate dates that span days or months by checking the intersection of the date
+  range and the query range. Also add an option to the argument so you can do a
+  simple query for either the from or to date when checking the whole range
+  isn't the right solution.
+#307274 by ksenzee: Fix broken validation for absolute value in years back
+  /forward.
+#1173374 by fietserwin: Remove translation of the jQuery datepicker day and
+  month names, now handled by core.
+#1192020 by tim.plunkett: Fixed date granularity is too fragile in
+  date_field_all_day().
+#1110012 by KarenS: Remove 'parent' items from Views plugins, no longer needed?
+  See if this fixes the issue.
+#1183892 by KarenS: Initialize $identifier in date_views_filter_handler_simple.
+#1103290 by stickywes, ingaro: Change postgres 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS'
+  to 'FMYYYY-FMMM-FMDDTFMHH24:FMMI:FMSS'.
+#1186528 by jox: Make date field combo label translatable.
+#1123186 by KingJoshi: Fix misnamed date_part_hour_prefix in hook_theme().
+#1032942 by fietserwin: Rename date popup functions that are getting picked up
+  by theme('date').
+#1206756 by KarenS: More tweaks to the validation changes. They were blocking
+  zero times and causing some test failures.
+#1197352 by KarenS: Don't display language about from and to dates when there
+  is no todate.
+#1201288 by rafa0961: fix broken references to SQLSERVER.
+By KarenS: More work on cleaning up validation, add in some ideas from
+  fearlsgrove about checking the granularity of the input array against the
+  expected granularity.
+#1161006 Dates that should have time but do not were not correctly caught in
+  validation.
+By KarenS: Get rid of overlapping formatter functionality. There should be a
+  default formatter with the option to choose a date format as a setting, not a
+  formatter for each format. This was a leftover from the D6 functionality.
+#1159404 by mikeryan: Fix incorrect call to parse an rrule in
+  date_repeat_build_dates().
+#1160656 by jjs: Replace missing break in date_api.sql.inc that breaks
+  PostgreSQL.
+#1150454 by KarenS: Fix undefined index notices for repeat_collapsed value.
+#1150462 by KarenS: Put length limit on content type names created by Date Tools
+  so block delta won't overflow the allowed size.
+#1136734 by KarenS: When migrating date format data from D6 to D7, don't try to
+  overwrite existing custom values.
+#1161042 by Ollie222: Date filters using time were inconsistently formatted.
+#1130884 by KarenS: Bad logic in 'between' filter SQL, should always join with
+  AND.
+#1139418 by ankur: Bad logic in week argument SQL, should always join with AND.
+#1118356 by KarenS: Disabling the Timepicker was having no effect.
+#408770 by vkareh: Make sure dates with #access = FALSE get passed through
+  date_combo_element_process().
+#1037174 by das-peter: add ajax support to date popup.
+#1160614 by joelstein: Make sure date repeat rule gets split correctly no matter
+  which line endings were used.
+#1110708 by mr.baileys: Fix problem combining date filter with other exposed
+  filters.
+By KarenS: Switch some references to $node to use $entity instead.
+#1112206, add a dummy field to the date navigation bar query to keep it from
+  trying to create invalid sql.
+#1112206, $this->view->query->clear_fields() is still need for date_browser to
+  keep Views from trying to use missing field values.
+By KarenS: Date browser only works with date_argument, should work with any
+  argument derived from date.
+
+
+Date 7.x-2.0-alpha3, 2011-04-26
+-------------------------------
+#1138700 by KarenS: missed a couple references to the construct() function.
+
+
+Date 7.x-2.0-alpha2, 2011-04-26
+-------------------------------
+By KarenS: Follow up to Issue #1103290, constructor was not set up correctly and
+  did not get triggered, so none of the date handlers had a db_type.
+#1138622 by KarenS: preliminary pass at adding support for SQL Server.
+#1136618 by ksenzee, Fix broken hide/show capability for date filter values.
+#1059078 Add preliminary support for SQLite dates.
+#1103290 by kevintheday, Use db_driver() to determine database engine.
+By KarenS: The 'now' values got broken again somewhere along the line. Now we
+  need to switch the ISO format used by our SQL queries back to the datetime
+  format the widgets use.
+By KarenS: Looks like Views changed ['expose']['operator'] to
+  ['expose']['operator_id'].
+#1115770, Make sure filters values are switched back to ISO format so time
+  comparisons work correctly.
+#1132916 by znerol, Fix a couple more usages of date_default_timezone_name().
+#1131308 by KarenS: Don't try to do timzone conversion when there is no
+  localzone for a field.
+#1093222 Fix broken function to remove calendar views.
+#820670 Add update to move D6 date format data to D7 data.
+1074344 Fix problem with date select widget that keeps resetting pm back to am.
+#1001186 by KarenS: Make sure that a 2 digit year is flagged as an error.
+#1117420 by threewestwinds: Make timepicker formats more useful.
+#1126408 by thekevinday: Add more sql formats to date api.
+#1129326 by robertom: Add missing value to element in date_combo.
+#998220 by jamsilver, yched: Fix handling of validation in date_combo. This
+  also fixes errors when using a date in Profile 2 and Field Collections.
+#1022592 by andypost, tim.plunkett optimize hook_form_alter into
+  hook_form_FORMID_alter.
+1021424 by joostvdl, wiizzard: Fix context in translations to use core values.
+By KarenS: Remove extra fields from the Date field. I think the filter and
+  argument now get the right tables joined in without that. We still need the
+  extra fields on calendar, but now we will only add them in the calendar view.
+By KarenS: Fix some notices in vcalendar theme.
+By KarenS: Fix the mini calendar querystring.
+By KarenS: Fix logic for day argument formula.
+By KarenS: Fix logic for week argument formula.
+#1086582 by bojanz: Summary options are in a different place now, fix the method
+  of removing the summary option on multiple-date arguments.
+By KarenS: Views renamed 'wildcard' to 'exception'.
+By KarenS: Apparently the handler->argument value is not always populated.
+By KarenS: Fix fallback value for date_group.
+#1103032 by tim.plunkett: Remove token integration code until Token module is
+  fixed.
+By KarenS: Now that there is no group of 'Fields' we need different tests to
+  tell if this is a field filter.
+By KarenS: Views changed the group name of fields from 'Fields' to 'Content'.
+  Blech, broke everything.
+By KarenS: Fix potential error if handler is broken.
+By KarenS: Remove reference to a function that no longer exists in Views.
+#1116962 by jpontani, mordonez: Parse Error - date_views_fields.inc on line 119.
+By KarenS: Fix the logic for year and month only dates.
+By KarenS: Add helper function to test if handler is a date handler.
+By KarenS: Fix broken handling when creating dates from timestamps.
+By KarenS: Set some defaults for dates without month or day.
+##1094408 by Boobaa: Date field not showing up in views arguments in localized
+  site
+#1018412 by omerida: get_class() called without object.
+By KarenS: There were some problems when creating a year-only date using the
+  select filter caused by trying to create a date with zeros in the month and
+  day. Fix the date building logic to force a valid month and day into them.
+By KarenS: Complex filters were not using the date handler of the individual
+  fields.
+#1100934 by KarenS: Replace deprecated date_array() function.
+By KarenS: #1096246 Date argument also was not applying the group method in the
+  right place in the query, causing that method to be applied to all filters.
+By KarenS: Missed a couple places when re-naming the get_value() function in the
+  filter.
+By KarenS: Fix more notices.
+#1096246 by KarenS: Date filter was not apply the group method in the right
+  place in the query, causing that method to be applied to all filters.
+By KarenS: Fix undefined index notice.
+By KarenS: Remove non-used function.
+#1082654 by arlinsandbulte: Remove master branch files and explain in readme.txt
+#906622 by bfroehle: Start cleanup of Date token code.
+By KarenS: Fix typo in form processing.
+By KarenS: Clean up the admin summary for the date filter.
+By KarenS: Fix another use of get_value() in the filter.
+By KarenS: Fix some strict errors in the views filter.
+#1094408 by Boobaa: Date field not showing up in views arguments in localized.
+  site.
+#1041428 by tim.plunkett: Fix logic errors in 'All Day' computations.
+#1054458 by KarenS: Move date_increment_round() function into Date API module so
+  it is always available.
+#745074 by rsevero:  Don't test for valid timezone-adjusted date for dates that
+  don't use time.
+#1076992 by KarenS: The timezone element never got completely updated to D7.
+#1013662 by developer-x: Remove check for start and end date - this prevented
+  multiday-all day events from showing 'All Day'.
+
+
+Date 7.x-2.0-alpha1, 2011-03-09
+-------------------------------
+Start a new 7.x-2.x branch that will contain a complete re-work of the Views
+handling.
+
+The 7.x-2.x branch will totally re-work and simplify the Views filters. These
+changes may/will break some views and will require that you check views that use
+the date filter or argument to be sure they are still configured correctly.
+
+There is a new date_filter_handler_simple for an individual date field that
+simplifies the Views handling by using most of the core Views field handling but
+adds in the possibility to set a default date using options like 'now', along
+with a choice of a month/day/year drop-down selector or popup calendar selector.
+
+The date_filter_handler is an extension of the simple handler that allows you to
+combine multiple dates into a single filter so that you can control all of them
+with the same filter widget, allowing you to either 'OR' or 'AND' them together.
+
+The arguments will be rewritten in the same way, with a simple argument handler
+for individual dates and another handler that extends that to control multiple
+dates with a single argument.
+
+#1082658 by KarenS: Saving the options as arrays breaks other things. Add a
+  custom export plugin instead.
+#1082658 by KarenS: Views options need to be declared as arrays or they are not
+  saved in the export in Views 3.
+#1075896 by KarenS: Break out the code into the simple argument and a complex
+  argument that combines date fields.
+#1075890 by KarenS: Break out the code into the simple filter and a complex
+  filter that combines date fields.
+By KarenS: Add some error trapping in case the parent dateObject is unable to
+  make a date out of a string to avoid showing the user errors.
+#1027752 by B-Prod and dboulet, Fix missing table join on argument summary
+  view.
+#1047412 by das-peter - Using date filter in February causes "The day is
+  invalid" error.
+#1014162 Now that the datefield processing expands to date & time, the
+  form_value is corrupted.
+By KarenS: Changes to the data migration code to work with latest iteration of
+  Content Migrate.
diff --git a/drupal7/sites/all/modules/date/README.txt b/drupal7/sites/all/modules/date/README.txt
index 75464988..6fbdafb9 100644
--- a/drupal7/sites/all/modules/date/README.txt
+++ b/drupal7/sites/all/modules/date/README.txt
@@ -1,223 +1,73 @@
-INFORMATION FOR DEVELOPERS
-
-Once the Date API is installed, all functions in the API are available to be
-used anywhere by any module.
-
-The API uses the PHP 5.2 date functions to create and manipulate dates.
-
-Example, the following will create a date for the local value in one
-timezone, adjust it to a different timezone, then return the offset in seconds
-in the new timezone for the input date; The offset will be adjusted for both
-the timezone difference and daylight savings time, if necessary:
-
-$date = date_create('2007-03-11 02:00:00', timezone_open('America/Chicago'));
-$chicago_time = date_format($date, 'Y-m-d H:i');
-
-print 'At '. $chicago_time .' in Chicago, the timezone offset in seconds
-  was '. date_offset_get($date);
-
-date_timezone_set($date, timezone_open('Europe/Berlin');
-$berlin_time = date_format($date, 'Y-m-d H:i');
-
-print 'It was '. $berlin_time .' in Berlin when it
-  was '. $chicago_time .' in Chicago.';
-print 'At that time in Berlin, the timezone offset in seconds was
-  '. date_offset_get($date);
-
-A helper class is available, new DateObject($string, $timezone, $format), where
-$string is a unixtimestamp, an ISO date, or a string like YYYY-MM-DD HH:MM:SS,
-$timezone is the name of the timezone this date is in, and $format is the format
-of date it is (DATE_FORMAT_UNIX, DATE_FORMAT_ISO, or DATE_FORMAT_DATETIME). It
-creates and return a date object set to the right date and timezone.
-
-Simpletest tests for these functions are included in the package.
-
-Available functions include the following (more documentation is provided in
-the files):
-
-============================================================================
-Preconfigured arrays
-============================================================================
-Both translated and untranslated values are available. The
-date_week_days_ordered() function will shift an array of week day names so it
-starts with the site's first day of the week, otherwise the weekday names start
-with Sunday as the first value, which is the expected order for many php and sql
-functions.
-
-date_month_names();
-date_month_names_abbr();
-date_month_names_untranslated();
-date_week_days();
-date_week_days_abbr();
-date_week_days_untranslated();
-date_week_days_ordered();
-date_years();
-date_hours();
-date_minutes();
-date_seconds();
-date_timezone_names();
-date_ampm();
-
-============================================================================
-Miscellaneous date manipulation functions
-============================================================================
-Pre-defined constants and functions that will handle pre-1970 and post-2038
-dates in both PHP 4 and PHP 5, in any OS. Dates can be converted from one
-type to another and date parts can be extracted from any date type.
-
-DATE_DATETIME
-DATE_ISO
-DATE_UNIX
-DATE_ARRAY
-DATE_OBJECT
-DATE_ICAL
-
-date_convert()
-date_is_valid();
-date_part_is_valid();
-date_part_extract();
-
-============================================================================
-Date calculation and navigation
-============================================================================
-date_difference() will find the time difference between any two days, measured
-in seconds, minutes, hours, days, months, weeks, or years.
-
-date_days_in_month();
-date_days_in_year();
-date_weeks_in_year();
-date_last_day_of_month();
-date_day_of_week();
-date_day_of_week_name();
-date_difference();
-
-============================================================================
-Date regex and format helpers
-============================================================================
-Pre-defined constants, an array of date format strings and their
-equivalent regex strings.
-
-DATE_REGEX_LOOSE is a very loose regex that will pull date parts out
-of an ISO date with or without separators, using either 'T' or a space
-to separate date and time, and with or without time.
-
-date_format_date() is similar to format_date(), except it takes a
-date object instead of a timestamp as the first parameter.
-
-DATE_FORMAT_ISO
-DATE_FORMAT_DATETIME
-DATE_FORMAT_UNIX
-DATE_FORMAT_ICAL
-
-DATE_REGEX_ISO
-DATE_REGEX_DATETIME
-DATE_REGEX_LOOSE
-
-date_format_date();
-date_short_formats();
-date_medium_formats();
-date_long_formats();
-date_format_patterns();
-
-============================================================================
-Standardized ical parser and creator
-============================================================================
-The iCal parser is found in date_api_ical.inc, which is not included by default.
-Include that file if you want to use these functions:
-
-Complete rewrite of ical imports to parse vevents, vlocations, valarms,
-and all kinds of timezone options and repeat rules for ical imports.
-The function now sticks to parsing the ical into an array that can be used
-in various ways. It no longer trys to convert timezones while parsing,
-instead a date_ical_date_format() function is provided that can be used to
-convert from the ical timezone to whatever timezone is desired in the
-results. Repeat rules are parsed into an array which other modules can
-manipulate however they like to create additional events from the results.
-
-date_ical_export();
-date_ical_import();
-date_ical_date_format();
-
-============================================================================
-Helpers for portable date SQL
-============================================================================
-The SQL functions are found in date_api_sql.inc, which is not included by
-default. Include that file if you want to use these functions:
-
-date_sql();
-date_server_zone_adj();
-date_sql_concat();
-date_sql_pad();
-
-============================================================================
-Date forms and validators
-============================================================================
-Reusable, configurable, self-validating FAPI date elements are found in
-date_api_elements.inc, which is not included by default. Include it
-if you want to use these elements. To use them, create a form element
-and set the '#type' to one of the following:
-
-date_select
- The date_select element will create a collection of form elements, with a
- separate select or textfield for each date part. The whole collection will
- get reformatted back into a date value of the requested type during validation.
-
-date_text
- The date_text element will create a textfield that can contain a whole
- date or any part of a date as text. The user input value will be re-formatted
- back into a date value of the requested type during validation.
-
-date_timezone
- The date_timezone element will create a drop-down selector to pick a
- timezone name.
-
-The custom date elements require a few other pieces of information to work
-correctly, like #date_format and #date_type. See the internal documentation
-for more information.
-
-============================================================================
-Date Popup Module
-============================================================================
-
-A new module is included in the package that will enable a popup jQuery
-calendar date picker and timepicker in date and time fields.
-
-It is implemented as a custom form element, so set '#type' to 'date_popup'
-to use this element. See the internal documentation for more information.
-
-============================================================================
-Date Repeat API
-============================================================================
-
-An API for repeating dates is available if installed. It can be used by
-other modules to create a form element that will allow users to select
-repeat rules and store those selections in an iCal RRULE string, and a
-calculation function that will parse the RRULE and return an array of dates
-that match those rules. The API is implemented in the Date module as a
-new date widget if the Date Repeat API is installed.
-
-============================================================================
-RDF Integration
-============================================================================
-
-To make RDF easier to use, the base date themes (date_display_single and
-date_display_range) have been expanded so they pass attributes and
-RDF mappings for the field, if any, to the theme. If RDF is installed
-and no other mappings are provided, the theme adds RDF information
-to mark both the Start and End dates as 'xsd:dateTime' datatypes with the
-property of 'dc:date'. This occurs in the theme preprocess layer, in
-particular via the functions template_preprocess_date_display_single() and
-template_preprocess_date_display_range().
-
-To mark these as events instead, you could install the schemaorg
-module, which will load the schema.org vocabulary. The mark the content type
-that contains events as an 'Event', using the UI exposed by that
-module and set the event start date field with the 'dateStart'
-property and tag other fields in the content type with the appropriate
-property types. The Date module theme will wrap the start and end
-date output with appropriate markup.
-
-If the result is not quite what you need, you should be able to implement your
-own theme preprocess functions, e.g. MYTHEME_preprocess_date_display_single()
-or MYTHEME_preprocess_date_display_range() and alter the attributes to use the
-values you want.
+Date
+----
+The Date module suite provides an API for handling date values, a field for
+Drupal 7's Field API system, and a wealth of submodules for various purposes.
+
+The following modules are included in the Date package, many of which have their
+own README.txt files with further information:
+
+* date_api/date_api.module:
+  A dependency for all of the other modules, provides a slew of APIs for the
+  other modules to leverage.
+
+* date.module:
+  Provides the Field API integration necessary to use date fields in the Drupal
+  7 UI, or in custom modules.
+
+* date_all_day/date_all_day.module:
+  Provides the option to add an 'All Day' checkbox to toggle time on and off
+  for date fields. It also contains the theme that displays the 'All Day' text
+  on fields that have no time.
+
+* date_context/date_context.module
+  Provides integration with the Context module [1], allowing the date to be used
+  as a condition on context definitions.
+
+* date_popup/date_popup.module
+  Adds a field widget for use with date and time fields that uses a jQuery-based
+  calendar-style date picker and timepicker.
+
+* date_repeat/date_repeat.module
+  Provides an API for calculating repeating dates and times from iCal rules.
+
+* date_repeat/date_repeat_field.module
+  Creates the option of repeating date fields and manages Date fields that use
+  the Date Repeat API.
+
+* date_tools/date_tools.module
+  Provides functionality for importing content with dates.
+
+* date_views/date_views.module
+  Adds integration with the Views module [2] for adding date fields and filters
+  to views.
+
+
+Credits / contact
+--------------------------------------------------------------------------------
+Currently maintained by Andrii Podanenko [3], Alex Schedrov [4], Damien McKenna
+[5] and Vijaya Chandran Mani [6]. Previous maintainers included Angie Byron
+[7], Arlin Sandbulte [8], David Goode [9], Derek Wright [10], developer-x [11]
+and Peter Lieverdink [12].
+
+Originally written and maintained by Karen Stevenson [13].
+
+The best way to contact the authors is to submit an issue, be it a support
+request, a feature request or a bug report, in the project issue queue:
+  https://www.drupal.org/project/issues/date
+
+
+References
+--------------------------------------------------------------------------------
+1: https://www.drupal.org/project/context
+2: https://www.drupal.org/project/views
+3: https://www.drupal.org/u/podarok
+4: https://www.drupal.org/u/sanchiz
+5: https://www.drupal.org/u/damienmckenna
+6: https://www.drupal.org/u/vijaycs85
+7: https://www.drupal.org/u/webchick
+8: https://www.drupal.org/u/arlinsandbulte
+9: https://www.drupal.org/user/291318
+10: https://www.drupal.org/u/dww
+11: https://www.drupal.org/user/399625
+12: https://www.drupal.org/u/cafuego
+13: https://www.drupal.org/u/karens
diff --git a/drupal7/sites/all/modules/date/date.api.php b/drupal7/sites/all/modules/date/date.api.php
index 268ae868..df3090ad 100644
--- a/drupal7/sites/all/modules/date/date.api.php
+++ b/drupal7/sites/all/modules/date/date.api.php
@@ -40,7 +40,7 @@ function hook_date_default_argument_alter(&$argument, &$value) {
  *   - rdf_mapping: The RDF mapping array.
  *   - add_rdf: If module_exists('rdf').
  */
-function hook_date_formatter_pre_view_alter(&$entity, &$variables) {
+function hook_date_formatter_pre_view_alter(&$entity, array &$variables) {
   if (!empty($entity->view)) {
     $field = $variables['field'];
     $date_id = 'date_id_' . $field['field_name'];
@@ -68,7 +68,7 @@ function hook_date_formatter_pre_view_alter(&$entity, &$variables) {
  *   - item: The $item array.
  *   - display: The $display array.
  */
-function hook_date_formatter_dates_alter(&$dates, $context) {
+function hook_date_formatter_dates_alter(array &$dates, array $context) {
   $field = $context['field'];
   $instance = $context['instance'];
   $format = $context['format'];
@@ -90,7 +90,8 @@ function hook_date_formatter_dates_alter(&$dates, $context) {
       'date2' => $date2,
       'format' => $format,
       'entity_type' => $entity_type,
-      'entity' => $entity));
+      'entity' => $entity,
+    ));
     $all_day2 = theme('date_all_day', array(
       'field' => $field,
       'instance' => $instance,
@@ -99,7 +100,8 @@ function hook_date_formatter_dates_alter(&$dates, $context) {
       'date2' => $date2,
       'format' => $format,
       'entity_type' => $entity_type,
-      'entity' => $entity));
+      'entity' => $entity,
+    ));
     $dates['value']['formatted_time'] = theme('date_all_day_label');
     $dates['value2']['formatted_time'] = theme('date_all_day_label');
     $dates['value']['formatted'] = $all_day1;
@@ -117,7 +119,7 @@ function hook_date_formatter_dates_alter(&$dates, $context) {
  * @param array $input
  *   The array of input values to be validated.
  */
-function hook_date_text_pre_validate_alter(&$element, &$form_state, &$input) {
+function hook_date_text_pre_validate_alter(array &$element, array &$form_state, array &$input) {
   // Let Date module massage the format for all day values so they will pass
   // validation. The All day flag, if used, actually exists on the parent
   // element.
@@ -134,7 +136,7 @@ function hook_date_text_pre_validate_alter(&$element, &$form_state, &$input) {
  * @param array $input
  *   The array of input values to be validated.
  */
-function hook_date_select_pre_validate_alter(&$element, &$form_state, &$input) {
+function hook_date_select_pre_validate_alter(array &$element, array &$form_state, array &$input) {
   // Let Date module massage the format for all day values so they will pass
   // validation. The All day flag, if used, actually exists on the parent
   // element.
@@ -151,7 +153,7 @@ function hook_date_select_pre_validate_alter(&$element, &$form_state, &$input) {
  * @param array $input
  *   The array of input values to be validated.
  */
-function hook_date_popup_pre_validate_alter(&$element, &$form_state, &$input) {
+function hook_date_popup_pre_validate_alter(array &$element, array &$form_state, array &$input) {
   // Let Date module massage the format for all day values so they will pass
   // validation. The All day flag, if used, actually exists on the parent
   // element.
@@ -173,9 +175,8 @@ function hook_date_popup_pre_validate_alter(&$element, &$form_state, &$input) {
  *
  * @see date_combo_element_process()
  */
-function hook_date_combo_pre_validate_alter(&$element, &$form_state, $context) {
+function hook_date_combo_pre_validate_alter(array &$element, array &$form_state, array $context) {
   if (!empty($context['item']['all_day'])) {
-
     $field = $context['field'];
 
     // If we have an all day flag on this date and the time is empty, change the
@@ -200,12 +201,12 @@ function hook_date_combo_pre_validate_alter(&$element, &$form_state, $context) {
  *   A keyed array containing the current state of the form.
  * @param array $context
  *   An associative array containing the following keys:
- *  - field: The $field array.
- *  - instance: The $instance array.
- *  - item: The $item array.
- *  - element: The $element array.
+ *   - field: The $field array.
+ *   - instance: The $instance array.
+ *   - item: The $item array.
+ *   - element: The $element array.
  */
-function hook_date_combo_validate_date_start_alter(&$date, &$form_state, $context) {
+function hook_date_combo_validate_date_start_alter(object &$date, array &$form_state, array $context) {
   // If this is an 'All day' value, set the time to midnight.
   if (!empty($context['element']['#date_is_all_day'])) {
     $date->setTime(0, 0, 0);
@@ -224,12 +225,12 @@ function hook_date_combo_validate_date_start_alter(&$date, &$form_state, $contex
  *   A keyed array containing the current state of the form.
  * @param array $context
  *   An associative array containing the following keys:
- *  - field: The $field array.
- *  - instance: The $instance array.
- *  - item: The $item array.
- *  - element: The $element array.
+ *   - field: The $field array.
+ *   - instance: The $instance array.
+ *   - item: The $item array.
+ *   - element: The $element array.
  */
-function hook_date_combo_validate_date_end_alter(&$date, &$form_state, $context) {
+function hook_date_combo_validate_date_end_alter(object &$date, array &$form_state, array $context) {
   // If this is an 'All day' value, set the time to midnight.
   if (!empty($context['element']['#date_is_all_day'])) {
     $date->setTime(0, 0, 0);
@@ -249,7 +250,7 @@ function hook_date_combo_validate_date_end_alter(&$date, &$form_state, $context)
  *
  * @see date_text_element_process()
  */
-function hook_date_text_process_alter(&$element, &$form_state, $context) {
+function hook_date_text_process_alter(array &$element, array &$form_state, array $context) {
   $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
   if ($all_day_id != '') {
     // All Day handling on text dates works only if the user leaves the time out
@@ -270,7 +271,7 @@ function hook_date_text_process_alter(&$element, &$form_state, $context) {
  *
  * @see date_select_element_process()
  */
-function hook_date_select_process_alter(&$element, &$form_state, $context) {
+function hook_date_select_process_alter(array &$element, array &$form_state, array $context) {
   // Hide or show the element in reaction to the all_day status for the element.
   $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
   if ($all_day_id != '') {
@@ -299,7 +300,7 @@ function hook_date_select_process_alter(&$element, &$form_state, $context) {
  *
  * @see date_popup_element_process()
  */
-function hook_date_popup_process_alter(&$element, &$form_state, $context) {
+function hook_date_popup_process_alter(array &$element, array &$form_state, array $context) {
   // Hide or show the element in reaction to the all_day status for the element.
   $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
   if ($all_day_id != '' && array_key_exists('time', $element)) {
@@ -324,7 +325,7 @@ function hook_date_popup_process_alter(&$element, &$form_state, $context) {
  *   - instance: The $instance array.
  *   - form: Nested array of form elements that comprise the form.
  */
-function hook_date_combo_process_alter(&$element, &$form_state, $context) {
+function hook_date_combo_process_alter(array &$element, array &$form_state, array $context) {
   $field = $context['field'];
   $instance = $context['instance'];
   $field_name = $element['#field_name'];
@@ -365,7 +366,7 @@ function hook_date_combo_process_alter(&$element, &$form_state, $context) {
  *
  * @see date_timezone_element_process()
  */
-function hook_date_timezone_process_alter(&$element, &$form_state, $context) {
+function hook_date_timezone_process_alter(array &$element, array &$form_state, array $context) {
   // @todo.
 }
 
@@ -382,7 +383,7 @@ function hook_date_timezone_process_alter(&$element, &$form_state, $context) {
  *
  * @see date_year_range_element_process()
  */
-function hook_date_year_range_process_alter(&$element, &$form_state, $context) {
+function hook_date_year_range_process_alter(array &$element, array &$form_state, array $context) {
   // @todo.
 }
 
@@ -399,7 +400,7 @@ function hook_date_year_range_process_alter(&$element, &$form_state, $context) {
  *
  * @see hook_field_settings_form()
  */
-function hook_date_field_settings_form_alter(&$form, $context) {
+function hook_date_field_settings_form_alter(array &$form, array $context) {
   $field = $context['field'];
   $instance = $context['instance'];
   $has_data = $context['has_data'];
@@ -427,7 +428,7 @@ function hook_date_field_settings_form_alter(&$form, $context) {
  *
  * @see hook_field_instance_settings_form()
  */
-function hook_date_field_instance_settings_form_alter(&$form, $context) {
+function hook_date_field_instance_settings_form_alter(array &$form, array $context) {
   $field = $context['field'];
   $instance = $context['instance'];
   $form['new_setting'] = array(
@@ -449,7 +450,7 @@ function hook_date_field_instance_settings_form_alter(&$form, $context) {
  *
  * @see hook_field_widget_settings_form()
  */
-function hook_date_field_widget_settings_form_alter(&$form, $context) {
+function hook_date_field_widget_settings_form_alter(array &$form, array $context) {
   $field = $context['field'];
   $instance = $context['instance'];
   $form['new_setting'] = array(
@@ -474,7 +475,7 @@ function hook_date_field_widget_settings_form_alter(&$form, $context) {
  *
  * @see hook_field_formatter_settings_form()
  */
-function hook_date_field_formatter_settings_form_alter(&$form, &$form_state, $context) {
+function hook_date_field_formatter_settings_form_alter(array &$form, array &$form_state, array $context) {
   $field = $context['field'];
   $instance = $context['instance'];
   $view_mode = $context['view_mode'];
@@ -486,7 +487,8 @@ function hook_date_field_formatter_settings_form_alter(&$form, &$form_state, $co
       '#type' => 'select',
       '#options' => array(
         'show' => t('Show repeat rule'),
-        'hide' => t('Hide repeat rule')),
+        'hide' => t('Hide repeat rule'),
+      ),
       '#default_value' => $settings['show_repeat_rule'],
       '#access' => $field['settings']['repeat'],
       '#weight' => 5,
@@ -508,7 +510,7 @@ function hook_date_field_formatter_settings_form_alter(&$form, &$form_state, $co
  *
  * @see hook_field_formatter_settings_summary()
  */
-function hook_date_field_formatter_settings_summary_alter(&$summary, $context) {
+function hook_date_field_formatter_settings_summary_alter(array &$summary, array $context) {
   $field = $context['field'];
   $instance = $context['instance'];
   $view_mode = $context['view_mode'];
diff --git a/drupal7/sites/all/modules/date/date.devel_generate.inc b/drupal7/sites/all/modules/date/date.devel_generate.inc
index 6c61e23c..d6e2433c 100644
--- a/drupal7/sites/all/modules/date/date.devel_generate.inc
+++ b/drupal7/sites/all/modules/date/date.devel_generate.inc
@@ -7,22 +7,15 @@
 
 /**
  * Implements hook_devel_generate().
- *
- * Included only when needed.
  */
 function date_devel_generate($entity, $field, $instance, $bundle) {
-
   $entity_field = array();
   if (isset($instance['widget']['settings']['year_range'])) {
     $split = explode(':', $instance['widget']['settings']['year_range']);
     // Determine how much to go back and forward depending on whether a relative
     // number of years (with - or + sign) or an absolute year is given.
-    $back = strpos($split[0], '-') === 0
-      ? str_replace('-', '', $split[0])
-      : date_format(date_now(), 'Y') - $split[0];
-    $forward = strpos($split[1], '+') === 0
-      ? str_replace('+', '', $split[1])
-      : $split[1] - date_format(date_now(), 'Y');
+    $back = $split[0];
+    $forward = $split[1];
   }
   else {
     $back = 2;
@@ -30,7 +23,8 @@ function date_devel_generate($entity, $field, $instance, $bundle) {
   }
   // Pick a random year within the time range,
   // and a random second within that year.
-  $year = date_format(date_now(), 'Y') - $back + mt_rand(0, ($forward + $back));
+  $this_year = date_format(date_now(), 'Y');
+  $year = mt_rand($this_year + $back, $this_year + $forward);
   $start = new DateObject($year . '-01-01 00:00:00', date_get_timezone_db($field['settings']['tz_handling']));
   $leap = date_format($start, 'L');
   $max_days = $leap ? 366 : 365;
@@ -39,17 +33,16 @@ function date_devel_generate($entity, $field, $instance, $bundle) {
   $increment = $instance['widget']['settings']['increment'];
   date_increment_round($start, $increment);
 
-  // Modify End date by 1 hour to 3 days, shorter for repeating dates
-  // longer for others.
-  $start2 = clone($start);
+  // Modify End date by 1 hour to 3 days, shorter for repeating dates longer
+  // for others.
+  $start2 = clone $start;
   $max = !empty($field['settings']['repeat']) ? 720 : 4320;
   $max = 240;
   date_modify($start2, '+' . mt_rand(60, $max) . ' minutes');
   date_increment_round($start2, $increment);
 
   if ($field['settings']['tz_handling'] == 'date') {
-    // Choose a random timezone.
-    // Not all keys exist, so we have to check.
+    // Choose a random timezone. Not all keys exist, so we have to check.
     $timezones = array_keys(date_timezone_names(TRUE));
     $key = mt_rand(0, count($timezones) - 1);
     if (!array_key_exists($key, $timezones)) {
@@ -86,5 +79,4 @@ function date_devel_generate($entity, $field, $instance, $bundle) {
   date_timezone_set($start2, timezone_open($timezone));
   $entity_field['offset2'] = date_offset_get($start2);
   return $entity_field;
-
 }
diff --git a/drupal7/sites/all/modules/date/date.diff.inc b/drupal7/sites/all/modules/date/date.diff.inc
index e46d3a1f..843f2a72 100644
--- a/drupal7/sites/all/modules/date/date.diff.inc
+++ b/drupal7/sites/all/modules/date/date.diff.inc
@@ -32,7 +32,6 @@ function date_field_diff_view($items, $context) {
       case 'value2':
         $diff_items[$delta] = $date[$display['settings']['fromto']]['formatted'];
         break;
-
     }
   }
   return $diff_items;
diff --git a/drupal7/sites/all/modules/date/date.field.inc b/drupal7/sites/all/modules/date/date.field.inc
index 7aef97be..275caf8c 100644
--- a/drupal7/sites/all/modules/date/date.field.inc
+++ b/drupal7/sites/all/modules/date/date.field.inc
@@ -15,10 +15,11 @@ function date_field_formatter_info() {
       'field types' => array('date', 'datestamp', 'datetime'),
       'settings' => array(
         'format_type' => 'long',
+        'custom_date_format' => '',
+        'fromto' => 'both',
         'multiple_number' => '',
         'multiple_from' => '',
         'multiple_to' => '',
-        'fromto' => 'both',
         'show_remaining_days' => FALSE,
       ),
     ),
@@ -28,7 +29,7 @@ function date_field_formatter_info() {
       'settings' => array(
         'interval' => 2,
         'interval_display' => 'time ago',
-        'use_end_date' => false,
+        'use_end_date' => FALSE,
       ),
     ),
     'date_plain' => array(
@@ -53,7 +54,6 @@ function date_field_formatter_settings_form($field, $instance, $view_mode, $form
 
     default:
       $form = date_default_formatter_settings_form($field, $instance, $view_mode, $form, $form_state);
-      break;
   }
   $context = array(
     'field' => $field,
@@ -78,7 +78,6 @@ function date_field_formatter_settings_summary($field, $instance, $view_mode) {
 
     default:
       $summary = date_default_formatter_settings_summary($field, $instance, $view_mode);
-      break;
   }
   $context = array(
     'field' => $field,
@@ -92,28 +91,24 @@ function date_field_formatter_settings_summary($field, $instance, $view_mode) {
 
 /**
  * Implements hook_field_formatter_view().
- *
- * Useful values:
- *
- *   $entity->date_id
- *     If set, this will show only an individual date on a field with
- *     multiple dates. The value should be a string that contains
- *     the following values, separated with periods:
- *     - module name of the module adding the item
- *     - node nid
- *     - field name
- *     - delta value of the field to be displayed
- *     - other information the module's custom theme might need
- *
- *     Used by the calendar module and available for other uses.
- *     example: 'date:217:field_date:3:test'
- *
- *   $entity->date_repeat_show
- *     If true, tells the theme to show all the computed values
- *     of a repeating date. If not true or not set, only the
- *     start date and the repeat rule will be displayed.
  */
 function date_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
+  // Useful values:
+  // - $entity->date_id
+  //   If set, this will show only an individual date on a field with
+  //   multiple dates. The value should be a string that contains
+  //   the following values, separated with periods:
+  //   - module name of the module adding the item
+  //   - node nid
+  //   - field name
+  //   - delta value of the field to be displayed
+  //   - other information the module's custom theme might need
+  //   Used by the calendar module and available for other uses.
+  //   example: 'date:217:field_date:3:test'
+  // - $entity->date_repeat_show
+  //   If TRUE, tells the theme to show all the computed values
+  //   of a repeating date. If not TRUE or not set, only the
+  //   start date and the repeat rule will be displayed.
   $element = array();
   $settings = $display['settings'];
   $formatter = $display['type'];
@@ -176,8 +171,9 @@ function date_field_formatter_view($entity_type, $entity, $field, $instance, $la
             $element[$delta] = array(
               '#markup' => t('!start-date to !end-date', array(
                 '!start-date' => $item['value'],
-                '!end-date' => $item['value2']
-              )));
+                '!end-date' => $item['value2'],
+              )),
+            );
           }
         }
       }
@@ -215,8 +211,13 @@ function date_field_formatter_view($entity_type, $entity, $field, $instance, $la
           }
         }
       }
-      break;
   }
+
+  // Add the CSS stylesheet only if we have something to display.
+  if (!empty($element)) {
+    $element['#attached']['css'][] = drupal_get_path('module', 'date_api') . '/date.css';
+  }
+
   return $element;
 }
 
@@ -224,8 +225,7 @@ function date_field_formatter_view($entity_type, $entity, $field, $instance, $la
  * Implements hook_field_is_empty().
  */
 function date_field_is_empty($item, $field) {
-  // Sometimes a $item is a date object.
-  // Coming from repeating dates. Why??
+  // Sometimes a $item is a date object. Coming from repeating dates. Why??
   if (!is_array($item)) {
     return FALSE;
   }
@@ -373,12 +373,13 @@ function date_field_validate($entity_type, $entity, $field, $instance, $langcode
     foreach ($items as $delta => $item) {
       if (is_array($item) && isset($item['value'])) {
         $process = date_process_values($field, $instance);
-        $date1 = new DateObject($item['value'], $item['timezone'], date_type_format($field['type']));
-        if (count($process) == 1 || (empty($item['value2']) && $item['value2'] !== 0)) {
-          $date2 = clone($date1);
+        $timezone = date_get_timezone($field['settings']['tz_handling'], isset($item['timezone']) ? $item['timezone'] : '');
+        $date1 = new DateObject($item['value'], $timezone, date_type_format($field['type']));
+        if (count($process) === 1 || (empty($item['value2']) && $item['value2'] !== 0)) {
+          $date2 = clone $date1;
         }
         else {
-          $date2 = new DateObject($item['value2'], $item['timezone'], date_type_format($field['type']));
+          $date2 = new DateObject($item['value2'], $timezone, date_type_format($field['type']));
         }
         $valid1 = $date1->validGranularity($field['settings']['granularity'], $flexible);
         $valid2 = $date2->validGranularity($field['settings']['granularity'], $flexible);
@@ -411,6 +412,7 @@ function date_field_presave($entity_type, $entity, $field, $instance, $langcode,
   if (empty($items)) {
     return;
   }
+
   // Add some information needed to interpret token values.
   $values = $items;
   foreach ($values as $delta => $item) {
@@ -454,11 +456,10 @@ function date_field_update($entity_type, $entity, $field, $instance, $langcode,
 
 /**
  * Implements hook_field_instance_settings_form().
- *
- * Wrapper functions for date administration, included only when processing
- * field settings.
  */
 function date_field_instance_settings_form($field, $instance) {
+  // Wrapper functions for date administration, included only when processing
+  // field settings.
   module_load_include('inc', 'date', 'date_admin');
   return _date_field_instance_settings_form($field, $instance);
 }
@@ -505,15 +506,14 @@ function date_field_settings_validate(&$form, &$form_state) {
 
 /**
  * Implements hook_content_migrate_field_alter().
- *
- * Use this to tweak the conversion of field settings from the D6 style to the
- * D7 style for specific situations not handled by basic conversion, as when
- * field types or settings are changed.
- *
- * $field_value['widget_type'] is available to see what widget type was
- * originally used.
  */
 function date_content_migrate_field_alter(&$field_value, $instance_value) {
+  // Use this to tweak the conversion of field settings from the D6 style to the
+  // D7 style for specific situations not handled by basic conversion, as when
+  // field types or settings are changed.
+  //
+  // $field_value['widget_type'] is available to see what widget type was
+  // originally used.
   switch ($field_value['module']) {
     case 'date':
       // Those settings do not exist anymore, or have been moved to the instance
@@ -526,15 +526,13 @@ function date_content_migrate_field_alter(&$field_value, $instance_value) {
 
 /**
  * Implements hook_content_migrate_instance_alter().
- *
- * Use this to tweak the conversion of instance or widget settings from the D6
- * style to the D7 style for specific situations not handled by basic
- * conversion, as when formatter or widget names or settings are changed.
  */
 function date_content_migrate_instance_alter(&$instance_value, $field_value) {
+  // Use this to tweak the conversion of instance or widget settings from the D6
+  // style to the D7 style for specific situations not handled by basic
+  // conversion, as when formatter or widget names or settings are changed.
   switch ($instance_value['widget']['module']) {
     case 'date':
-
       // Some settings have been moved from field to instance.
       $instance_value['widget']['settings']['repeat_collapsed'] = $field_value['settings']['repeat_collapsed'];
 
diff --git a/drupal7/sites/all/modules/date/date.info b/drupal7/sites/all/modules/date/date.info
index 28263b42..7b913f22 100644
--- a/drupal7/sites/all/modules/date/date.info
+++ b/drupal7/sites/all/modules/date/date.info
@@ -1,23 +1,33 @@
 name = Date
 description = Makes date/time fields available.
-dependencies[] = date_api
+dependencies[] = date:date_api
 package = Date/Time
 core = 7.x
-php = 5.2
+
+; Integration with the migrate module.
 files[] = date.migrate.inc
-files[] = tests/date_api.test
-files[] = tests/date.test
-files[] = tests/date_field.test
-files[] = tests/date_migrate.test
-files[] = tests/date_validation.test
-files[] = tests/date_timezone.test
-files[] = tests/date_views_pager.test
-files[] = tests/date_views_popup.test
-files[] = tests/date_form.test
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+; Dependencies for test coverage.
+test_dependencies[] = entity:entity
+test_dependencies[] = features:features (2.x)
+test_dependencies[] = migrate:migrate
+test_dependencies[] = views:views
+
+; Test coverage: standalone tests.
+files[] = tests/DateEmwTestCase.test
+files[] = tests/DateFormTestCase.test
+files[] = tests/DateMigrateTestCase.test
+files[] = tests/DateNowUnitTestCase.test
+
+; The remaining tests depend upon this one.
+files[] = tests/DateFieldTestBase.test
+files[] = tests/DateFieldTestCase.test
+files[] = tests/DateTimezoneTestCase.test
+files[] = tests/DateUiTestCase.test
+files[] = tests/DateValidationTestCase.test
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date.install b/drupal7/sites/all/modules/date/date.install
index 765b90cf..a75b1ca3 100644
--- a/drupal7/sites/all/modules/date/date.install
+++ b/drupal7/sites/all/modules/date/date.install
@@ -14,6 +14,7 @@ function date_field_schema($field) {
     case 'datestamp':
       $db_columns['value'] = array(
         'type' => 'int',
+        'size' => 'big',
         'not null' => FALSE,
         'sortable' => TRUE,
         'views' => TRUE,
@@ -41,7 +42,6 @@ function date_field_schema($field) {
         'sortable' => TRUE,
         'views' => TRUE,
       );
-      break;
   }
 
   // If a second date is needed for 'End date', make a copy of the first one.
@@ -51,6 +51,16 @@ function date_field_schema($field) {
     // We don't want Field API to create additional columns, just the first.
     // We modify them our own way in views data.
     $db_columns['value2']['views'] = FALSE;
+
+    // Create a compound index on value and value2 and an index on value2.
+    $indexes = array(
+      'value' => array('value', 'value2'),
+      'value2' => array('value2'),
+    );
+  }
+  else {
+    // Otherwise just an index on value.
+    $indexes = array('value' => array('value'));
   }
   // Timezone and offset columns are used only if date-specific dates are used.
   if (isset($field['settings']['tz_handling']) && $field['settings']['tz_handling'] == 'date') {
@@ -72,7 +82,7 @@ function date_field_schema($field) {
         'type' => 'int',
         'not null' => FALSE,
         'sortable' => TRUE,
-        'views' => FALSE
+        'views' => FALSE,
       );
     }
   }
@@ -84,7 +94,7 @@ function date_field_schema($field) {
       'views' => FALSE,
     );
   }
-  return array('columns' => $db_columns);
+  return array('columns' => $db_columns, 'indexes' => $indexes);
 }
 
 /**
@@ -134,13 +144,14 @@ function date_update_7001() {
   $query->condition(db_or()->condition('fc.type', 'date')->condition('fc.type', 'datestamp')->condition('fc.type', 'datetime'));
   $results = $query->execute();
 
+  $allowed_types = array(
+    'date_popup_repeat',
+    'date_text_repeat',
+    'date_select_repeat',
+  );
   foreach ($results as $record) {
     $instance = unserialize($record['data']);
-    if (in_array($instance['widget']['type'], array(
-        'date_popup_repeat',
-        'date_text_repeat',
-        'date_select_repeat'
-      ))) {
+    if (in_array($instance['widget']['type'], $allowed_types)) {
       $instance['widget']['type'] = str_replace('_repeat', '', $instance['widget']['type']);
       db_update('field_config_instance')
         ->fields(array(
@@ -212,3 +223,93 @@ function date_update_7005() {
   // @see https://www.drupal.org/node/1355256
   date_update_7004();
 }
+
+/**
+ * Add date value indexes to existed field tables.
+ */
+function date_update_7006() {
+  // Get all fields provided by the Data module.
+  $query = db_select('field_config', 'f')
+    ->fields('f', array('id', 'field_name', 'data'))
+    ->condition('f.type', array('datetime', 'date', 'datestamp'));
+
+  // Special handling for the Encrypt module.
+  if (module_exists('field_encrypt')) {
+    $query->condition('f.data', '%' . db_like(' field_encrypt";a:1:{s:7:"encrypt";i:0 ') . '%', 'LIKE');
+  }
+
+  // Complete the query.
+  $fields = $query->execute()->fetchAllAssoc('id');
+
+  foreach ($fields as $id => $info) {
+    $field_info = field_info_field($info->field_name);
+
+    // Add indexes only for SQL storage fields.
+    if ($field_info['storage']['type'] != 'field_sql_storage') {
+      continue;
+    }
+
+    $tables = array(
+      key($field_info['storage']['details']['sql']['FIELD_LOAD_CURRENT']),
+      key($field_info['storage']['details']['sql']['FIELD_LOAD_REVISION']),
+    );
+
+    $data = unserialize($info->data);
+    $field_name = $info->field_name . '_value';
+    $field_name2 = $info->field_name . '_value2';
+
+    // Build indexes.
+    $indexes = $data['indexes'] = array();
+    if (!empty($data['settings']['todate'])) {
+      $indexes[$field_name] = array($field_name, $field_name2);
+      $indexes[$field_name2] = array($field_name2);
+      $data['indexes']['value'] = array('value', 'value2');
+      $data['indexes']['value2'] = array('value2');
+    }
+    else {
+      $indexes[$field_name] = array($field_name);
+      $data['indexes']['value'] = array('value');
+    }
+
+    // Add missed indexes to tables.
+    foreach ($indexes as $name => $index) {
+      foreach ($tables as $table) {
+        if (!db_index_exists($table, $name)) {
+          db_add_index($table, $name, $index);
+        }
+      }
+    }
+
+    // Fix date fields storage 'field_config' indexes.
+    db_update('field_config')
+      ->fields(array('data' => serialize($data)))
+      ->condition('id', $id)
+      ->execute();
+  }
+}
+
+/**
+ * Update datestamp field schema to use 'big' integers.
+ */
+function date_update_7007() {
+  $fields = field_read_fields(array('type' => 'datestamp'));
+  foreach ($fields as $field_name => $field) {
+    foreach (array_intersect_key($field['columns'], drupal_map_assoc(array('value', 'value2'))) as $column_name => $schema) {
+      $schema['size'] = 'big';
+      $column = $field_name . '_' . $column_name;
+      if (db_table_exists('field_data_' . $field_name)) {
+        db_change_field('field_data_' . $field_name, $column, $column, $schema);
+      }
+      if (db_table_exists('field_revision_' . $field_name)) {
+        db_change_field('field_revision_' . $field_name, $column, $column, $schema);
+      }
+    }
+  }
+}
+
+/**
+ * The date_migrate_example module was renamed.
+ */
+function date_update_7200() {
+  db_delete('system')->condition('name', 'date_migrate_example')->execute();
+}
diff --git a/drupal7/sites/all/modules/date/date.migrate.inc b/drupal7/sites/all/modules/date/date.migrate.inc
index 90c1ec51..dc95c9ff 100644
--- a/drupal7/sites/all/modules/date/date.migrate.inc
+++ b/drupal7/sites/all/modules/date/date.migrate.inc
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Support for migration into Date fields.
@@ -9,16 +10,8 @@ if (!class_exists('MigrateFieldHandler')) {
 }
 
 /**
- * Implements hook_migrate_api().
+ * Support for migration into Date fields.
  */
-function date_migrate_api() {
-  $api = array(
-    'api' => 2,
-    'field handlers' => array('DateMigrateFieldHandler'),
-  );
-  return $api;
-}
-
 class DateMigrateFieldHandler extends MigrateFieldHandler {
 
   /**
@@ -112,7 +105,7 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
 
       // Legacy support for JSON containing a set of properties - deprecated
       // now that we have subfields.
-      if (!empty($from) && $from{0} == '{') {
+      if (!empty($from) && $from[0] == '{') {
         $properties = drupal_json_decode($from);
         $from = $properties['from'];
         // Properties passed in with the date override any set via arguments.
@@ -127,9 +120,8 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
         }
       }
 
-      // Missing data? Create an empty value and return;
-      // Don't try to turn the empty value into a bogus
-      // timestamp for 'now'.
+      // Missing data? Create an empty value and return; Don't try to turn the
+      // empty value into a bogus timestamp for 'now'.
       if (empty($from)) {
         $return[$language][$delta]['value'] = NULL;
         $return[$language][$delta]['timezone'] = NULL;
@@ -171,9 +163,6 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
             $to = format_date($to, 'custom', 'Y-m-d\TH:i:s', $timezone);
           }
           break;
-
-        default:
-          break;
       }
 
       // Handle repeats, coming in as RRULEs. Many field instances may be
@@ -212,4 +201,5 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
       'to' => t('End date date'),
     );
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/date.module b/drupal7/sites/all/modules/date/date.module
index e667b5dd..005ebab3 100644
--- a/drupal7/sites/all/modules/date/date.module
+++ b/drupal7/sites/all/modules/date/date.module
@@ -20,8 +20,8 @@ function date_get_entity_bundle($entity_type, $entity) {
 
     default:
       $bundle = field_extract_bundle($entity_type, $entity);
-      break;
   }
+
   // If there is no bundle name, field_info() uses the entity name as the bundle
   // name in its arrays.
   if (empty($bundle)) {
@@ -157,7 +157,7 @@ function date_theme() {
 /**
  * Implements hook_element_info().
  *
- * date_combo will create a 'start' and optional 'end' date, along with
+ * Date_combo will create a 'start' and optional 'end' date, along with
  * an optional 'timezone' column for date-specific timezones. Each
  * 'start' and 'end' date will be constructed from date_select or date_text.
  */
@@ -170,6 +170,9 @@ function date_element_info() {
     '#process' => array('date_combo_element_process'),
     '#element_validate' => array('date_combo_validate'),
     '#theme_wrappers' => array('date_combo'),
+    '#attached' => array('css' => array(
+      drupal_get_path('module', 'date_api') . '/date.css',
+    )),
   );
   if (module_exists('ctools')) {
     $type['date_combo']['#pre_render'] = array('ctools_dependent_pre_render');
@@ -185,7 +188,7 @@ function date_element_info() {
  * @param string $formatter
  *   The date formatter.
  * @param string $entity_type
- *   The entity_type for the instance
+ *   The entity_type for the instance.
  * @param object $entity
  *   The entity object.
  * @param array $field
@@ -215,7 +218,7 @@ function date_element_info() {
  *       )
  *     )
  */
-function date_formatter_process($formatter, $entity_type, $entity, $field, $instance, $langcode, $item, $display) {
+function date_formatter_process($formatter, $entity_type, $entity, array $field, array $instance, $langcode, array $item, array $display) {
   $dates = array();
   $timezone = date_default_timezone();
   if (empty($timezone)) {
@@ -338,12 +341,12 @@ function _get_custom_date_format($date, $format) {
  * $field['settings']['granularity'] will contain an array like
  * ('hour' => 'hour', 'month' => 0) where the values turned on return their own
  * names and the values turned off return a zero need to reconfigure this into
- * simple array of the turned on values
+ * simple array of the turned on values.
  *
  * @param array $field
  *   The field array.
  */
-function date_granularity($field) {
+function date_granularity(array $field) {
   if (!is_array($field) || !is_array($field['settings']['granularity'])) {
     $granularity = drupal_map_assoc(array('year', 'month', 'day'));
     $field['settings']['granularity'] = $granularity;
@@ -352,9 +355,15 @@ function date_granularity($field) {
 }
 
 /**
- * Helper function to create an array of the date values in a field that need to be processed.
+ * Create an array of the date values in a field that need to be processed.
+ *
+ * @param array $field
+ *   The field being processed.
+ *
+ * @return array
+ *   The date values which need to be processed.
  */
-function date_process_values($field) {
+function date_process_values(array $field) {
   return $field['settings']['todate'] ? array('value', 'value2') : array('value');
 }
 
@@ -449,7 +458,6 @@ function date_formatter_format($formatter, $settings, $granularity = array(), $l
       else {
         $format = date_format_type_format($format_type, $langcode);
       }
-      break;
   }
 
   // A selected format might include timezone information.
@@ -471,7 +479,7 @@ function date_format_type_format($format_type, $langcode = NULL) {
     // we receive (due to inconsistency of core api) an array of all (other)
     // formats available for $langcode in locale table.
     // However there's no guarantee that the key $format_type exists.
-    // See http://drupal.org/node/1302358.
+    // @see http://drupal.org/node/1302358
     if (!is_string($format)) {
       // If the configuration page at admin/config/regional/date-time was
       // never saved, the default core date format variables
@@ -493,19 +501,17 @@ function date_format_type_format($format_type, $langcode = NULL) {
         case 'medium':
         default:
           // @todo: If a non-core module provides a date type and does not
-          // variable_set() a default for it, the default assumed here may
-          // not be correct (since the default format used by 'medium' may
-          // not even be one of the allowed formats for the date type in
-          // question). To fix this properly, we should really call
-          // system_get_date_formats($format_type) and take the first
-          // format from that list as the default. However, this function
-          // is called often (on many different page requests), so calling
+          // variable_set() a default for it, the default assumed here may not
+          // be correct (since the default format used by 'medium' may not even
+          // be one of the allowed formats for the date type in question). To
+          // fix this properly, we should really call
+          // system_get_date_formats($format_type) and take the first format
+          // from that list as the default. However, this function is called
+          // often (on many different page requests), so calling
           // system_get_date_formats() from here would be a performance hit
-          // since that function writes several records to the database
-          // during each page request that calls it.
+          // since that function writes several records to the database during
+          // each page request that calls it.
           $default = 'D, m/d/Y - H:i';
-          break;
-
       }
       $format = variable_get('date_format_' . $format_type, $default);
     }
@@ -656,7 +662,7 @@ function date_entity_metadata_struct_getter($item, array $options, $name, $type,
     return NULL;
   }
 
-  $timezone_db = !empty($item['timezone_db']) ? $item['timezone_db'] : 'UTC';
+  $timezone_db = date_get_timezone_db($info['field']['settings']['tz_handling']);
   $date = new DateObject($value, $timezone_db);
   return !empty($date) ? date_format_date($date, 'custom', 'U') : NULL;
 }
@@ -714,7 +720,8 @@ function date_entity_metadata_struct_create($name, $property_info) {
  *
  * Based on entity_property_verbatim_set().
  *
- * The passed in unix timestamp (UTC) is converted to the right value and format dependent on the field.
+ * The passed in unix timestamp (UTC) is converted to the right value and format
+ * dependent on the field.
  *
  * $name is either 'value' or 'value2'.
  */
@@ -736,25 +743,37 @@ function date_entity_metadata_struct_setter(&$item, $name, $value, $langcode, $t
 }
 
 /**
- * Duplicate functionality of what is now date_all_day_field() in the Date All Day module.
+ * Duplicate of what is now date_all_day_field() in the Date All Day module.
  *
- * Copy left here to avoid breaking other modules that use this function.
+ * Left here to avoid breaking other modules that use this function.
  *
- * DEPRECATED!, will be removed at some time in the future.
+ * DEPRECATED! Will be removed at some time in the future.
  */
 function date_field_all_day($field, $instance, $date1, $date2 = NULL) {
   if (empty($date1) || !is_object($date1)) {
     return FALSE;
   }
   elseif (!date_has_time($field['settings']['granularity'])) {
-    return TRUE;
+    return FALSE;
   }
+  // The master setting for the 'all day' functionality.
+  elseif (empty($instance['settings']['widget']['settings']['display_all_day'])) {
+    return FALSE;
+  }
+
   if (empty($date2)) {
     $date2 = $date1;
   }
 
+  // Use central logic for determining the granularity.
   $granularity = date_granularity_precision($field['settings']['granularity']);
-  $increment = isset($instance['widget']['settings']['increment']) ? $instance['widget']['settings']['increment'] : 1;
+
+  // The increment is 1 by default, but it can be overridden.
+  $increment = 1;
+  if (isset($instance['widget']['settings']['increment'])) {
+    $increment = $instance['widget']['settings']['increment'];
+  }
+
   return date_is_all_day(date_format($date1, DATE_FORMAT_DATETIME), date_format($date2, DATE_FORMAT_DATETIME), $granularity, $increment);
 }
 
@@ -771,7 +790,7 @@ function date_field_all_day($field, $instance, $date1, $date2 = NULL) {
  *
  * DEPRECATED!, will be removed at some time in the future.
  */
-function date_field_get_sql_handler($field, $compare_tz = NULL) {
+function date_field_get_sql_handler(array $field, $compare_tz = NULL) {
   module_load_include('inc', 'date_api', 'date_api_sql');
 
   $db_info = date_api_database_info($field);
@@ -802,11 +821,11 @@ function date_field_get_sql_handler($field, $compare_tz = NULL) {
 
 /**
  * Implements hook_field_widget_properties_alter().
- *
- * Alters the widget properties of a field instance before it gets displayed.
- * Used here to flag new entities so we can later tell if they need default values.
  */
-function date_field_widget_properties_alter(&$widget, $context) {
+function date_field_widget_properties_alter(array &$widget, $context) {
+  // Alters the widget properties of a field instance before it gets displayed.
+  // Used here to flag new entities so we can later tell if they need default
+  // values.
   if (in_array($widget['type'], array('date_select', 'date_text', 'date_popup'))) {
     $entity_type = $context['entity_type'];
     $entity = $context['entity'];
@@ -818,3 +837,14 @@ function date_field_widget_properties_alter(&$widget, $context) {
     }
   }
 }
+
+/**
+ * Implements hook_migrate_api().
+ */
+function date_migrate_api() {
+  $api = array(
+    'api' => 2,
+    'field handlers' => array('DateMigrateFieldHandler'),
+  );
+  return $api;
+}
diff --git a/drupal7/sites/all/modules/date/date.theme b/drupal7/sites/all/modules/date/date.theme
index c4ea352a..00776ad6 100644
--- a/drupal7/sites/all/modules/date/date.theme
+++ b/drupal7/sites/all/modules/date/date.theme
@@ -15,46 +15,46 @@
 /**
  * Returns HTML for a date element formatted as a Start/End combination.
  *
- *  $entity->date_id
- *    If set, this will show only an individual date on a field with
- *    multiple dates. The value should be a string that contains
- *    the following values, separated with periods:
- *    - module name of the module adding the item
- *    - node nid
- *    - field name
- *    - delta value of the field to be displayed
- *    - other information the module's custom theme might need
+ * $entity->date_id
+ *   If set, this will show only an individual date on a field with
+ *   multiple dates. The value should be a string that contains
+ *   the following values, separated with periods:
+ *   - module name of the module adding the item
+ *   - node nid
+ *   - field name
+ *   - delta value of the field to be displayed
+ *   - other information the module's custom theme might need.
  *
- *    Used by the calendar module and available for other uses.
- *    example: 'date.217.field_date.3.test'
+ *   Used by the calendar module and available for other uses.
+ *   example: 'date.217.field_date.3.test'
  *
- *  $entity->date_repeat_show
- *    If true, tells the theme to show all the computed values of a repeating
- *    date. If not true or not set, only the start date and the repeat rule
- *    will be displayed.
+ * $entity->date_repeat_show
+ *   If TRUE, tells the theme to show all the computed values of a repeating
+ *   date. If not TRUE or not set, only the start date and the repeat rule
+ *   will be displayed.
  *
- *  $dates['format']
- *    The format string used on these dates
- *  $dates['value']['local']['object']
- *    The local date object for the Start date
- *  $dates['value2']['local']['object']
- *    The local date object for the End date
- *  $dates['value']['local']['datetime']
- *    The datetime value of the Start date database (GMT) value
- *  $dates['value2']['local']['datetime']
- *    The datetime value of the End date database (GMT) value
- *  $dates['value']['formatted']
- *    Formatted Start date, i.e. 'February 15, 2007 2:00 pm';
- *  $dates['value']['formatted_date']
- *    Only the date part of the formatted Start date
- *  $dates['value']['formatted_time']
- *    Only the time part of the formatted Start date
- *  $dates['value2']['formatted']
- *    Formatted End date, i.e. 'February 15, 2007 6:00 pm';
- *  $dates['value2']['formatted_date']
- *    Only the date part of the formatted End date
- *  $dates['value2']['formatted_time']
- *    Only the time part of the formatted End date
+ * $dates['format']
+ *   The format string used on these dates
+ * $dates['value']['local']['object']
+ *   The local date object for the Start date
+ * $dates['value2']['local']['object']
+ *   The local date object for the End date
+ * $dates['value']['local']['datetime']
+ *   The datetime value of the Start date database (GMT) value
+ * $dates['value2']['local']['datetime']
+ *   The datetime value of the End date database (GMT) value
+ * $dates['value']['formatted']
+ *   Formatted Start date, i.e. 'February 15, 2007 2:00 pm';
+ * $dates['value']['formatted_date']
+ *   Only the date part of the formatted Start date
+ * $dates['value']['formatted_time']
+ *   Only the time part of the formatted Start date
+ * $dates['value2']['formatted']
+ *   Formatted End date, i.e. 'February 15, 2007 6:00 pm';
+ * $dates['value2']['formatted_date']
+ *   Only the date part of the formatted End date
+ * $dates['value2']['formatted_time']
+ *   Only the time part of the formatted End date
  */
 function theme_date_display_combination($variables) {
   static $repeating_ids = array();
@@ -77,7 +77,6 @@ function theme_date_display_combination($variables) {
   $microdata   = $variables['microdata'];
   $add_microdata = $variables['add_microdata'];
   $precision   = date_granularity_precision($field['settings']['granularity']);
-  $show_remaining_days = $variables['show_remaining_days'];
 
   $output = '';
 
@@ -117,6 +116,26 @@ function theme_date_display_combination($variables) {
     $element['#entity'] = $entity;
   }
 
+  // Verify these variables exist.
+  if (!isset($dates['value']['formatted'])) {
+    $dates['value']['formatted'] = '';
+  }
+  if (!isset($dates['value2']['formatted'])) {
+    $dates['value2']['formatted'] = '';
+  }
+  if (!isset($dates['value']['formatted_time'])) {
+    $dates['value']['formatted_time'] = '';
+  }
+  if (!isset($dates['value2']['formatted_time'])) {
+    $dates['value2']['formatted_time'] = '';
+  }
+  if (!isset($dates['value1']['formatted_timezone'])) {
+    $dates['value1']['formatted_timezone'] = '';
+  }
+  if (!isset($dates['value2']['formatted_timezone'])) {
+    $dates['value2']['formatted_timezone'] = '';
+  }
+
   switch ($options['fromto']) {
     case 'value':
       $date1 = $dates['value']['formatted'];
@@ -156,9 +175,9 @@ function theme_date_display_combination($variables) {
 
   // Check remaining days.
   $show_remaining_days = '';
-  if (!empty($variables['show_remaining_days'])) {
-    $remaining_days = floor((strtotime($variables['dates']['value']['formatted_iso'])
-    - strtotime('now')) / (24 * 3600));
+  if (!empty($variables['show_remaining_days']) && isset($variables['dates']['value']['formatted_iso'])) {
+    $remaining_days = $variables['dates']['value']['formatted_iso'];
+    $remaining_days = floor((strtotime($remaining_days) - strtotime('now')) / (24 * 3600));
 
     // Show remaining days only for future events.
     if ($remaining_days >= 0) {
@@ -172,12 +191,13 @@ function theme_date_display_combination($variables) {
   if (empty($date1) && empty($date2)) {
     $output .= '';
   }
+
   // Start and End dates match or there is no End date, display a complete
   // single date.
   elseif ($date1 == $date2 || empty($date2)) {
     $output .= theme('date_display_single', array(
       'date' => $date1,
-      'timezone' => $timezone,
+      'timezone' => $has_time_string ? $timezone : '',
       'attributes' => $attributes,
       'rdf_mapping' => $rdf_mapping,
       'add_rdf' => $add_rdf,
@@ -187,6 +207,7 @@ function theme_date_display_combination($variables) {
       'show_remaining_days' => $show_remaining_days,
     ));
   }
+
   // Same day, different times, don't repeat the date but show both Start and
   // End times. We can NOT do this if the replacement value is an integer
   // instead of a time string.
@@ -216,12 +237,13 @@ function theme_date_display_combination($variables) {
       'dates' => $dates,
     ));
   }
+
   // Different days, display both in their entirety.
   else {
     $output .= theme('date_display_range', array(
       'date1' => $date1,
       'date2' => $date2,
-      'timezone' => $timezone,
+      'timezone' => $has_time_string ? $timezone : '',
       'attributes' => $attributes,
       'rdf_mapping' => $rdf_mapping,
       'add_rdf' => $add_rdf,
@@ -251,7 +273,7 @@ function template_preprocess_date_display_single(&$variables) {
     $variables['attributes'] = $variables['attributes'] + $base_attributes;
   }
 
-  // Pass along microdata attributes, or set display to false if none are set.
+  // Pass along microdata attributes, or set display to FALSE if none are set.
   if (!empty($variables['add_microdata'])) {
     // Because the Entity API integration for Date has a variable data
     // structure depending on whether there is an end value, the attributes
@@ -299,7 +321,7 @@ function template_preprocess_date_display_range(&$variables) {
   $variables['attributes_end'] += $variables['attributes'];
 
   if ($variables['add_rdf']) {
-    // Pass along the rdf mapping for this field, if any. Add some default rdf
+    // 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.
     $dates = $variables['dates'];
     $base_attributes = array(
@@ -315,7 +337,7 @@ function template_preprocess_date_display_range(&$variables) {
     }
   }
 
-  // Pass along microdata attributes, or set display to false if none are set.
+  // Pass along microdata attributes, or set display to FALSE if none are set.
   if ($variables['add_microdata']) {
     if (!empty($variables['microdata']['value']['#attributes'])) {
       $variables['microdata']['value']['#attributes']['content'] = $variables['dates']['value']['formatted_iso'];
@@ -336,7 +358,7 @@ function theme_date_display_range($variables) {
   $timezone = $variables['timezone'];
   $attributes_start = $variables['attributes_start'];
   $attributes_end = $variables['attributes_end'];
-  $show_remaining_days = $variables['show_remaining_days'];
+  $show_remaining_days = isset($variables['show_remaining_days']) ? $variables['show_remaining_days'] : '';
 
   $start_date = '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $date1 . '</span>';
   $end_date = '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $date2 . $timezone . '</span>';
@@ -379,7 +401,7 @@ function theme_date_display_interval($variables) {
     'interval' => $options['interval'],
     'interval_display' => $options['interval_display'],
     'use_end_date' => !empty($options['use_end_date']) ?
-      $options['use_end_date'] : FALSE,
+    $options['use_end_date'] : FALSE,
   );
 
   if ($return = theme('date_time_ago', $time_ago_vars)) {
@@ -462,11 +484,19 @@ function theme_date_form_element($variables) {
   // Detect if there is more than one subfield.
   $count = count(explode('<label', $element['#children'])) - 1;
   if ($count == 1) {
-    $element['#title_display'] = 'none';
+    // If there is only one subfield, hide the label of the main field only if
+    // the label of the subfield is visible.
+    if (empty($variables['element']['value']['#instance'])
+      || empty($variables['element']['value']['#instance']['widget'])
+      || empty($variables['element']['value']['#instance']['widget']['settings'])
+      || empty($variables['element']['value']['#instance']['widget']['settings']['label_position'])
+      || $variables['element']['value']['#instance']['widget']['settings']['label_position'] != 'none') {
+      $element['#title_display'] = 'none';
+    }
   }
 
   // Wrap children with a div and add an extra class if element is multiline.
-  $element['#children'] = '<div class="date-form-element-content'. ($multiline ? ' date-form-element-content-multiline' : '') .'">'. $element['#children'] .'</div>';
+  $element['#children'] = '<div class="date-form-element-content' . ($multiline ? ' date-form-element-content-multiline' : '') . '">' . $element['#children'] . '</div>';
 
   return theme('form_element', $variables);
 }
@@ -477,12 +507,13 @@ function theme_date_form_element($variables) {
 function theme_date_display_remaining($variables) {
   $remaining_days = $variables['remaining_days'];
   $output = '';
-  $show_remaining_text = t('The upcoming date less then 1 day.');
+  $show_remaining_text = t('Less than 1 day remaining');
   if ($remaining_days) {
-    $show_remaining_text = format_plural($remaining_days, 'To event remaining 1 day', 'To event remaining @count days');
+    $show_remaining_text = format_plural($remaining_days, '1 day remaining', '@count days remaining');
   }
 
   return '<div class="date-display-remaining"><span class="date-display-remaining">' . $show_remaining_text . '</span></div>';
 }
 
-/** @} End of addtogroup themeable */
+/**
+ * @} End of addtogroup themeable */
diff --git a/drupal7/sites/all/modules/date/date.tokens.inc b/drupal7/sites/all/modules/date/date.tokens.inc
index 5caab14b..18e27429 100644
--- a/drupal7/sites/all/modules/date/date.tokens.inc
+++ b/drupal7/sites/all/modules/date/date.tokens.inc
@@ -62,8 +62,8 @@ function date_tokens($type, $tokens, array $data = array(), array $options = arr
         date_timezone_set($date, timezone_open($item['timezone']));
       }
       $timestamp = !empty($date) ? date_format_date($date, 'custom', 'U') : '';
-      // Generate the token replacements, using the date token type provided
-      // by system.module.
+      // Generate the token replacements, using the date token type provided by
+      // system.module.
       $replacements += token_generate('date', $date_tokens, array('date' => $timestamp), $options);
     }
   }
diff --git a/drupal7/sites/all/modules/date/date_admin.inc b/drupal7/sites/all/modules/date/date_admin.inc
index b800201e..1cb91eab 100644
--- a/drupal7/sites/all/modules/date/date_admin.inc
+++ b/drupal7/sites/all/modules/date/date_admin.inc
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Date administration code.
+ * Date administration functionality.
  */
 
 /**
@@ -196,7 +196,7 @@ function date_default_formatter_settings_summary($field, $instance, $view_mode)
 /**
  * Settings summary for the interval formatter.
  *
- * @TODO Add settings later.
+ * @todo Add settings later.
  */
 function date_interval_formatter_settings_summary($field, $instance, $view_mode) {
   $summary = array();
@@ -205,7 +205,7 @@ function date_interval_formatter_settings_summary($field, $instance, $view_mode)
   $formatter = $display['type'];
   $field = ($settings['use_end_date'] == 1) ? 'End' : 'Start';
   $summary[] = t('Display time ago, showing @interval units. Using @field Date',
-      array('@interval' => $settings['interval'], '@field' => $field));
+    array('@interval' => $settings['interval'], '@field' => $field));
 
   return $summary;
 }
@@ -378,14 +378,16 @@ function _date_field_widget_settings_form($field, $instance) {
       '#weight' => 6,
     );
     $form['increment'] = array(
-      '#type' => 'select', '#title' => t('Time increments'),
+      '#type' => 'select',
+      '#title' => t('Time increments'),
       '#default_value' => $settings['increment'],
       '#options' => array(
         1 => t('1 minute'),
         5 => t('5 minute'),
         10 => t('10 minute'),
         15 => t('15 minute'),
-        30 => t('30 minute')),
+        30 => t('30 minute'),
+      ),
       '#weight' => 7,
       '#fieldset' => 'date_format',
     );
@@ -440,7 +442,7 @@ function _date_field_widget_settings_form($field, $instance) {
     '#description' => $description,
   );
   $form['advanced']['text_parts'] = array(
-    '#theme' => $widget['type'] == 'date_select' ? 'date_text_parts' : '',
+    '#theme' => $widget['type'] == 'date_select' ? 'date_text_parts' : NULL,
   );
   $text_parts = (array) $settings['text_parts'];
   foreach (date_granularity_names() as $key => $value) {
diff --git a/drupal7/sites/all/modules/date/date_admin.js b/drupal7/sites/all/modules/date/date_admin.js
index e3cde3fc..0323f0c3 100644
--- a/drupal7/sites/all/modules/date/date_admin.js
+++ b/drupal7/sites/all/modules/date/date_admin.js
@@ -1,81 +1,83 @@
+/**
+ * @file
+ */
 (function ($) {
 
-Drupal.behaviors.dateAdmin = {};
+  Drupal.behaviors.dateAdmin = {};
 
-Drupal.behaviors.dateAdmin.attach = function (context, settings) {
-  // Remove timezone handling options for fields without hours granularity.
-  var $hour = $('#edit-field-settings-granularity-hour').once('date-admin');
-  if ($hour.length) {
-    new Drupal.dateAdmin.TimezoneHandler($hour);
-  }
-};
+  Drupal.behaviors.dateAdmin.attach = function (context, settings) {
+    // Remove timezone handling options for fields without hours granularity.
+    var $hour = $('#edit-field-settings-granularity-hour').once('date-admin');
+    if ($hour.length) {
+      new Drupal.dateAdmin.TimezoneHandler($hour);
+    }
+  };
 
+  Drupal.dateAdmin = {};
 
-Drupal.dateAdmin = {};
-
-/**
+  /**
  * Constructor for the TimezoneHandler object.
  *
  * This object is responsible for showing the timezone handling options dropdown
  * when the user has chosen to collect hours as part of the date field, and
  * hiding it otherwise.
  */
-Drupal.dateAdmin.TimezoneHandler = function ($checkbox) {
-  this.$checkbox = $checkbox;
-  this.$dropdown = $('#edit-field-settings-tz-handling');
-  this.$timezoneDiv = $('.form-item-field-settings-tz-handling');
-  // Store the initial value of the timezone handling dropdown.
-  this.storeTimezoneHandling();
-  // Toggle the timezone handling section when the user clicks the "Hour"
-  // checkbox.
-  this.$checkbox.bind('click', $.proxy(this.clickHandler, this));
-  // Trigger the click handler so that if the checkbox is unchecked on initial
-  // page load, the timezone handling section will be hidden.
-  this.clickHandler();
-};
+  Drupal.dateAdmin.TimezoneHandler = function ($checkbox) {
+    this.$checkbox = $checkbox;
+    this.$dropdown = $('#edit-field-settings-tz-handling');
+    this.$timezoneDiv = $('.form-item-field-settings-tz-handling');
+    // Store the initial value of the timezone handling dropdown.
+    this.storeTimezoneHandling();
+    // Toggle the timezone handling section when the user clicks the "Hour"
+    // checkbox.
+    this.$checkbox.bind('click', $.proxy(this.clickHandler, this));
+    // Trigger the click handler so that if the checkbox is unchecked on initial
+    // page load, the timezone handling section will be hidden.
+    this.clickHandler();
+  };
 
-/**
- * Event handler triggered when the user clicks the "Hour" checkbox.
- */
-Drupal.dateAdmin.TimezoneHandler.prototype.clickHandler = function () {
-  if (this.$checkbox.is(':checked')) {
-    this.restoreTimezoneHandlingOptions();
-  }
-  else {
-    this.hideTimezoneHandlingOptions();
-  }
-};
+  /**
+   * Event handler triggered when the user clicks the "Hour" checkbox.
+   */
+  Drupal.dateAdmin.TimezoneHandler.prototype.clickHandler = function () {
+    if (this.$checkbox.is(':checked')) {
+      this.restoreTimezoneHandlingOptions();
+    }
+    else {
+      this.hideTimezoneHandlingOptions();
+    }
+  };
 
-/**
- * Hide the timezone handling options section of the form.
- */
-Drupal.dateAdmin.TimezoneHandler.prototype.hideTimezoneHandlingOptions = function () {
-  this.storeTimezoneHandling();
-  this.$dropdown.val('none');
-  this.$timezoneDiv.hide();
-};
+  /**
+   * Hide the timezone handling options section of the form.
+   */
+  Drupal.dateAdmin.TimezoneHandler.prototype.hideTimezoneHandlingOptions = function () {
+    this.storeTimezoneHandling();
+    this.$dropdown.val('none');
+    this.$timezoneDiv.hide();
+  };
 
-/**
- * Show the timezone handling options section of the form.
- */
-Drupal.dateAdmin.TimezoneHandler.prototype.restoreTimezoneHandlingOptions = function () {
-  var val = this.getTimezoneHandling();
-  this.$dropdown.val(val);
-  this.$timezoneDiv.show();
-};
+  /**
+   * Show the timezone handling options section of the form.
+   */
+  Drupal.dateAdmin.TimezoneHandler.prototype.restoreTimezoneHandlingOptions = function () {
+    var val = this.getTimezoneHandling();
+    this.$dropdown.val(val);
+    this.$timezoneDiv.show();
+  };
 
-/**
- * Store the current value of the timezone handling dropdown.
- */
-Drupal.dateAdmin.TimezoneHandler.prototype.storeTimezoneHandling = function () {
-  this._timezoneHandling = this.$dropdown.val();
-};
+  /**
+   * Store the current value of the timezone handling dropdown.
+   */
+  Drupal.dateAdmin.TimezoneHandler.prototype.storeTimezoneHandling = function () {
+    this._timezoneHandling = this.$dropdown.val();
+  };
 
-/**
- * Return the stored value of the timezone handling dropdown.
- */
-Drupal.dateAdmin.TimezoneHandler.prototype.getTimezoneHandling = function () {
-  return this._timezoneHandling;
-};
+  /**
+   * Return the stored value of the timezone handling dropdown.
+   */
+  Drupal.dateAdmin.TimezoneHandler.prototype.getTimezoneHandling = function () {
+    return this._timezoneHandling;
+  };
 
 })(jQuery);
diff --git a/drupal7/sites/all/modules/date/date_all_day/README.txt b/drupal7/sites/all/modules/date/date_all_day/README.txt
index d65a6d99..6b70e336 100644
--- a/drupal7/sites/all/modules/date/date_all_day/README.txt
+++ b/drupal7/sites/all/modules/date/date_all_day/README.txt
@@ -1,9 +1,9 @@
 Date All Day
+------------
+This module provides the option to add an 'All Day' checkbox to toggle time on
+and off for date fields. It also contains the theme that displays the 'All Day'
+text on fields that have no time.
 
-This module provides the option to add an 'All Day' checkbox to toggle time on 
-and off for date fields. It also contains the theme that displays the 'All Day' 
-text on fields that have no time. 
-
-Additionally, this module serves as an example of how other modules can inject 
-new functionality into date fields using various hooks provided by Date and by 
-the Field API.
\ No newline at end of file
+Additionally, this module serves as an example of how other modules can inject
+new functionality into date fields using various hooks provided by Date and by
+the Field API.
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 fcdc673a..f660d324 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
@@ -1,13 +1,17 @@
 name = Date All Day
 description = Adds 'All Day' functionality to date fields, including an 'All Day' theme and 'All Day' checkboxes for the Date select and Date popup widgets.
-dependencies[] = date_api
-dependencies[] = date
 package = Date/Time
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+dependencies[] = date:date_api
+dependencies[] = date:date
+
+; Test coverage.
+files[] = tests/DateAllDayUiTestCase.test
+files[] = tests/DateAllDayUpdatesTest.test
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date_all_day/date_all_day.install b/drupal7/sites/all/modules/date/date_all_day/date_all_day.install
new file mode 100644
index 00000000..c5876f74
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/date_all_day.install
@@ -0,0 +1,113 @@
+<?php
+
+/**
+ * @file
+ * Update scripts for the Date All Day module.
+ */
+
+/**
+ * Change old "all day" values.
+ *
+ * Old data was stored with values with the time set to "00:00:00" whereas new
+ * data is stored with the time set to "23:59:59" (the minutes value varies
+ * depending upon the field's "increment" value), while keeping the same date.
+ *
+ * @todo Run this through a sandbox.
+ */
+function date_all_day_update_7200() {
+  // Get all fields provided by the Data module. This is used instead of the
+  // usual field_read_fields() because we want to select three different field
+  // types, whereas the API only supports one at a time.
+  $field_names = db_select('field_config', 'f')
+    ->fields('f', array('field_name'))
+    ->condition('f.type', array('datetime', 'date', 'datestamp'), 'IN')
+    ->execute()
+    ->fetchCol();
+
+  // Keep track of the fields that were processed.
+  $fields_processed = array();
+
+  // Loop over each of the fields that was found.
+  foreach ($field_names as $field_name) {
+    // Get the full specs of this base field.
+    $field = field_read_field($field_name);
+
+    // Loop over each instance of this field.
+    $params = array(
+      'field_name' => $field_name,
+    );
+    foreach (field_read_instances($params) as $instance) {
+      if (!empty($instance['widget']['settings']['display_all_day'])) {
+        $fields_processed[] = $field_name;
+
+        // If this field has a "to" date, the column to change is the "value2"
+        // column, otherwise just change the primary column.
+        if (!empty($field['settings']['todate'])) {
+          $field_to_change = $field_name . '_value2';
+        }
+        else {
+          $field_to_change = $field_name . '_value';
+        }
+
+        // Manually fix each record.
+        $records = db_select('field_data_' . $field_name, 'f')
+          ->fields('f')
+          ->condition('f.entity_type', $instance['entity_type'])
+          ->condition('f.bundle', $instance['bundle'])
+          ->condition('f.' . $field_to_change, '%:00:00', 'LIKE')
+          ->execute();
+
+        // The value that the widget is set to increment by. This is stored in
+        // minutes.
+        $increment = 1;
+        if (isset($instance['widget']['settings']['increment'])) {
+          $increment = $instance['widget']['settings']['increment'];
+        }
+
+        foreach ($records as $record) {
+          // Extract the value and convert it to a timestamp.
+          $end_date_value = $record->{$field_to_change};
+          $date = strtotime($end_date_value);
+
+          // The old time was stored with the value of midnight the day before
+          // the date that was intended, e.g. if the date was 2020-10-17 the
+          // time was stored as 0:00:00 thus the saved value "2020-10-17
+          // 00:00:00". This needs to be converted to 1 second before midnight
+          // on *that* day, i.e. "2020-10-17 23:59:59".
+          // @see hook_date_combo_validate_date_end_alter()
+          // @see date_all_day_date_combo_validate_date_start_alter()
+          $date += 23 * 60 * 60; // 23 hours.
+          $date += (60 - $increment) * 60; // 60 minutes - $increment, e.g. 59.
+          $date += 59; // 59 seconds.
+
+          // Reformat the date using an appropriate format for storing in the
+          // database.
+          $date = date(DATE_FORMAT_DATETIME, $date);
+
+          // Update the record.
+          db_update('field_data_' . $field_name)
+            ->fields(array(
+              $field_to_change => $date,
+            ))
+            ->condition('entity_type', $record->entity_type)
+            ->condition('bundle', $record->bundle)
+            ->condition('deleted', $record->deleted)
+            ->condition('revision_id', $record->revision_id)
+            ->condition('language', $record->language)
+            ->condition('delta', $record->delta)
+            ->execute();
+
+          // Clear the caches for this entity.
+          entity_get_controller($record->entity_type)->resetCache(array($record->entity_id));
+        }
+      }
+    }
+  }
+
+  // If any data was converted clear the site's caches.
+  if ($fields_processed) {
+    drupal_flush_all_caches();
+  }
+
+  return t('Processed %fields.', array('%fields' => implode(', ', $fields_processed)));
+}
diff --git a/drupal7/sites/all/modules/date/date_all_day/date_all_day.module b/drupal7/sites/all/modules/date/date_all_day/date_all_day.module
index e79bc944..fc775fc2 100644
--- a/drupal7/sites/all/modules/date/date_all_day/date_all_day.module
+++ b/drupal7/sites/all/modules/date/date_all_day/date_all_day.module
@@ -4,16 +4,15 @@
  * @file
  * Adds All Day functionality to the Date field.
  *
- * This module implements a number of hooks in the Date field and
- * Date api element processing and to add an All Day checkbox to
- * date widgets, and also adds an All Day theme and
- * All Day information to the formatting.
+ * This module implements a number of hooks in the Date field and Date API
+ * element processing and to add an All Day checkbox to date widgets, and also
+ * adds an All Day theme and All Day information to the formatting.
  *
- * Keep in mind that the process hooks are fired from the top down,
- * first date_combo, then the date_select or date_popup.
+ * Keep in mind that the process hooks are fired from the top down, first
+ * date_combo, then the date_select or date_popup.
  *
- * Validation fires from the bottom up, first date_select and
- * date_popup, then date_combo.
+ * Validation fires from the bottom up, first date_select and date_popup, then
+ * date_combo.
  */
 
 /**
@@ -44,12 +43,9 @@ function date_all_day_theme() {
 
 /**
  * Implements hook_date_formatter_dates_alter().
- *
- * This allows us to alter the $dates array created
- * by date_formatter_process.
  */
 function date_all_day_date_formatter_dates_alter(&$dates, $context) {
-
+  // This allows us to alter the $dates array created by date_formatter_process.
   $field = $context['field'];
   $instance = $context['instance'];
   $format = $context['format'];
@@ -57,7 +53,6 @@ function date_all_day_date_formatter_dates_alter(&$dates, $context) {
   $entity = $context['entity'];
   $date1 = $dates['value']['local']['object'];
   $date2 = $dates['value2']['local']['object'];
-
   $is_all_day = date_all_day_field($field, $instance, $date1, $date2);
 
   $all_day1 = '';
@@ -71,7 +66,8 @@ function date_all_day_date_formatter_dates_alter(&$dates, $context) {
       'date2' => $date2,
       'format' => $format,
       'entity_type' => $entity_type,
-      'entity' => $entity));
+      'entity' => $entity,
+    ));
     $all_day2 = theme('date_all_day', array(
       'field' => $field,
       'instance' => $instance,
@@ -80,7 +76,8 @@ function date_all_day_date_formatter_dates_alter(&$dates, $context) {
       'date2' => $date2,
       'format' => $format,
       'entity_type' => $entity_type,
-      'entity' => $entity));
+      'entity' => $entity,
+    ));
     $dates['value']['formatted_time'] = theme('date_all_day_label');
     $dates['value2']['formatted_time'] = theme('date_all_day_label');
     $dates['value']['formatted'] = $all_day1;
@@ -91,39 +88,33 @@ function date_all_day_date_formatter_dates_alter(&$dates, $context) {
 /**
  * Adjust start/end date format to account for 'all day' .
  *
- * @params array $field
+ * @param array $field
  *   The field definition for this date field.
- *
- * @params string $which
+ * @param string $which
  *   Which value to return, 'date1' or 'date2'.
- *
- * @params object $date1
+ * @param object $date1
  *   A date/time object for the 'start' date.
- *
- * @params object $date2
+ * @param object $date2
  *   A date/time object for the 'end' date.
- *
- * @params string $format
- *   A date/time format
- *
- * @params object $entity
+ * @param string $format
+ *   A date/time format.
+ * @param object $entity
  *   The node this date comes from (may be incomplete, always contains nid).
- *
- * @params object $view
+ * @param object $view
  *   The view this node comes from, if applicable.
  *
- * @return string
+ * @return string|null
  *   Formatted date.
  */
 function theme_date_all_day($vars) {
-  $field    = $vars['field'];
+  $field = $vars['field'];
   $instance = $vars['instance'];
-  $which    = $vars['which'];
-  $date1    = $vars['date1'];
-  $date2    = $vars['date2'];
-  $format   = $vars['format'];
-  $entity   = $vars['entity'];
-  $view     = !empty($vars['view']) ? $vars['view'] : NULL;
+  $which = $vars['which'];
+  $date1 = $vars['date1'];
+  $date2 = $vars['date2'];
+  $format = $vars['format'];
+  $entity = $vars['entity'];
+  $view = !empty($vars['view']) ? $vars['view'] : NULL;
 
   if (empty($date1) || !is_object($date1) || $format == 'format_interval') {
     return;
@@ -156,7 +147,7 @@ function theme_date_all_day($vars) {
  * Theme the way an 'all day' label will look.
  */
 function theme_date_all_day_label() {
-  return '(' . t('All day', array(), array('context' => 'datetime')) . ')';
+  return t('(All day)', array(), array('context' => 'datetime'));
 }
 
 /**
@@ -164,42 +155,61 @@ function theme_date_all_day_label() {
  *
  * @param array $field
  *   The field definition for this date field.
- *
  * @param array $instance
  *   The field instance for this date field.
- *
  * @param object $date1
  *   A date/time object for the 'Start' date.
- *
  * @param object $date2
  *   A date/time object for the 'End' date.
  *
  * @return bool
  *   TRUE or FALSE.
  */
-function date_all_day_field($field, $instance, $date1, $date2 = NULL) {
+function date_all_day_field(array $field, array $instance, $date1, $date2 = NULL) {
   if (empty($date1) || !is_object($date1)) {
     return FALSE;
   }
   elseif (!date_has_time($field['settings']['granularity'])) {
-    return TRUE;
+    return FALSE;
+  }
+  // The master setting for the 'all day' functionality.
+  elseif (empty($instance['widget']['settings']['display_all_day'])) {
+    return FALSE;
   }
+
   if (empty($date2)) {
     $date2 = $date1;
   }
 
+  // Several scenarios result in the two date values being the same, e.g.
+  // date_formatter_process().
+  if ($date1 == $date2) {
+    // Clone the date object so that changes made to the object won't affect
+    // both variables.
+    $date1 = clone $date2;
+
+    // Set the time to midnight so that the two variables can be properly
+    // compared later in date_is_all_day().
+    $date1->setTime(0, 0, 0);
+  }
+
+  // Use central logic for determining the granularity.
   $granularity = date_granularity_precision($field['settings']['granularity']);
-  $increment = isset($instance['widget']['settings']['increment']) ? $instance['widget']['settings']['increment'] : 1;
+
+  // The increment is 1 by default, but it can be overridden.
+  $increment = 1;
+  if (isset($instance['widget']['settings']['increment'])) {
+    $increment = $instance['widget']['settings']['increment'];
+  }
+
   return date_is_all_day(date_format($date1, DATE_FORMAT_DATETIME), date_format($date2, DATE_FORMAT_DATETIME), $granularity, $increment);
 }
 
 /**
  * Implements hook_date_combo_process_alter().
- *
- * This hook lets us make changes to the date_combo element.
  */
 function date_all_day_date_combo_process_alter(&$element, &$form_state, $context) {
-
+  // This hook lets us make changes to the date_combo element.
   $field = $context['field'];
   $instance = $context['instance'];
 
@@ -211,13 +221,15 @@ function date_all_day_date_combo_process_alter(&$element, &$form_state, $context
     $all_day_id = $first_parent . '[' . implode('][', $parents) . '][all_day]';;
     foreach (array('value', 'value2') as $key) {
       if (array_key_exists($key, $element)) {
-        $element[$key]['#date_all_day_id']  = $all_day_id;
+        $element[$key]['#date_all_day_id'] = $all_day_id;
       }
     }
 
     $from = $element['#default_value']['value'];
     $to = !empty($element['#default_value']['value2']) ? $element['#default_value']['value2'] : $element['#default_value']['value'];
-    $date_is_all_day = date_is_all_day($from, $to);
+    $granularity = date_granularity_precision($context['field']['settings']['granularity']);
+    $increment = isset($context['instance']['widget']['settings']['increment']) ? $context['instance']['widget']['settings']['increment'] : 1;
+    $date_is_all_day = date_is_all_day($from, $to, $granularity, $increment);
     $all_day = !empty($form_state['values']['all_day']) || $date_is_all_day;
     $element['all_day'] = array(
       '#title' => t('All Day'),
@@ -236,30 +248,24 @@ function date_all_day_date_combo_process_alter(&$element, &$form_state, $context
   }
 }
 
-
 /**
  * Implements hook_date_text_process_alter().
- *
- * This hook lets us make changes to the date_select widget.
  */
 function date_all_day_date_text_process_alter(&$element, &$form_state, $context) {
+  // This hook lets us make changes to the date_select widget.
   $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
   if ($all_day_id != '') {
-    // All Day handling on text dates works only
-    // if the user leaves the time out of the input value.
-    // There is no element to hide or show.
+    // All Day handling on text dates works only if the user leaves the time
+    // out of the input value. There is no element to hide or show.
   }
 }
 
 /**
  * Implements hook_date_select_process_alter().
- *
- * This hook lets us make changes to the date_select widget.
  */
 function date_all_day_date_select_process_alter(&$element, &$form_state, $context) {
-
-  // Hide or show this element in reaction
-  // to the all_day status for this element.
+  // This hook lets us make changes to the date_select widget. Hide or show
+  // this element in reaction to the all_day status for this element.
   $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
   if ($all_day_id != '') {
     foreach (array('hour', 'minute', 'second', 'ampm') as $field) {
@@ -267,7 +273,8 @@ function date_all_day_date_select_process_alter(&$element, &$form_state, $contex
         $element[$field]['#states'] = array(
           'visible' => array(
             'input[name="' . $all_day_id . '"]' => array('checked' => FALSE),
-          ));
+          ),
+        );
       }
     }
   }
@@ -275,69 +282,60 @@ function date_all_day_date_select_process_alter(&$element, &$form_state, $contex
 
 /**
  * Implements hook_date_popup_process_alter().
- *
- * This hook lets us make changes to the date_popup element.
  */
 function date_all_day_date_popup_process_alter(&$element, &$form_state, $context) {
-
-  // Hide or show this element in reaction to
-  // the all_day status for this element.
+  // This hook lets us make changes to the date_popup element. Hide or show
+  // this element in reaction to the all_day status for this element.
   $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
   if ($all_day_id != '' && array_key_exists('time', $element)) {
     $element['time']['#states'] = array(
       'visible' => array(
         'input[name="' . $all_day_id . '"]' => array('checked' => FALSE),
-      ));
+      ),
+    );
   }
 }
 
 /**
  * Implements hook_date_select_pre_validate_alter().
- *
- * This hook lets us alter the element or the form_state before the rest
- * of the date_select validation gets fired.
  */
 function date_all_day_date_text_pre_validate_alter(&$element, &$form_state, &$input) {
-  // Let Date module massage the format for all day
-  // values so they will pass validation.
-  // The All day flag, if used, actually exists on the parent element.
+  // This hook lets us alter the element or the form_state before the rest of
+  // the date_select validation gets fired. Let Date module massage the format
+  // for all day values so they will pass validation. The All day flag, if
+  // used, actually exists on the parent element.
   date_all_day_value($element, $form_state);
 }
 
 /**
  * Implements hook_date_select_pre_validate_alter().
- *
- * This hook lets us alter the element or the form_state before the rest
- * of the date_select validation gets fired.
  */
 function date_all_day_date_select_pre_validate_alter(&$element, &$form_state, &$input) {
-  // Let Date module massage the format for all
-  // day values so they will pass validation.
-  // The All day flag, if used, actually exists on the parent element.
+  // This hook lets us alter the element or the form_state before the rest of
+  // the date_select validation gets fired. Let Date module massage the format
+  // for all day values so they will pass validation. The All day flag, if
+  // used, actually exists on the parent element.
   date_all_day_value($element, $form_state);
 }
 
 /**
  * Implements hook_date_select_pre_validate_alter().
- *
- * This hook lets us alter the element or the form_state before the rest
- * of the date_popup validation gets fired.
  */
 function date_all_day_date_popup_pre_validate_alter(&$element, &$form_state, &$input) {
-  // Let Date module massage the format for all
-  // day values so they will pass validation.
-  // The All day flag, if used, actually exists on the parent element.
+  // This hook lets us alter the element or the form_state before the rest of
+  // the date_popup validation gets fired. Let Date module massage the format
+  // for all day values so they will pass validation. The All day flag, if
+  // used, actually exists on the parent element.
   date_all_day_value($element, $form_state);
 }
 
 /**
  * A helper function date_all_day_value().
- *
- * To check if the all day flag is set on the parent of an
- * element, and adjust the date_format accordingly so the missing time will
- * not cause validation errors.
  */
 function date_all_day_value(&$element, $form_state) {
+  // To check if the all day flag is set on the parent of an element, and
+  // adjust the date_format accordingly so the missing time will not cause
+  // validation errors.
   if (!empty($element['#date_all_day_id'])) {
     $parents = $element['#parents'];
     array_pop($parents);
@@ -352,14 +350,11 @@ function date_all_day_value(&$element, $form_state) {
 
 /**
  * Implements hook_date_combo_pre_validate_alter().
- *
- * This hook lets us alter the element or the form_state before the rest
- * of the date_combo validation gets fired.
  */
 function date_all_day_date_combo_pre_validate_alter(&$element, &$form_state, $context) {
-
+  // This hook lets us alter the element or the form_state before the rest of
+  // the date_combo validation gets fired.
   if (!empty($context['item']['all_day'])) {
-
     $field = $context['field'];
 
     // If we have an all day flag on this date and the time is empty,
@@ -375,13 +370,11 @@ function date_all_day_date_combo_pre_validate_alter(&$element, &$form_state, $co
 
 /**
  * Implements hook_date_combo_validate_date_start_alter().
- *
- * This hook lets us alter the local date objects
- * created by the date_combo validation before they are
- * converted back to the database timezone and stored.
  */
 function date_all_day_date_combo_validate_date_start_alter(&$date, &$form_state, $context) {
-  // If this is an 'All day' value, set the time to midnight.
+  // This hook lets us alter the local date objects created by the date_combo
+  // validation before they are converted back to the database timezone and
+  // stored. If this is an 'All day' value, set the time to midnight.
   if (!empty($context['element']['#date_is_all_day'])) {
     $date->setTime(0, 0, 0);
   }
@@ -389,24 +382,26 @@ function date_all_day_date_combo_validate_date_start_alter(&$date, &$form_state,
 
 /**
  * Implements hook_date_combo_validate_date_end_alter().
- *
- * This hook lets us alter the local date objects
- * created by the date_combo validation before
- * they are converted back to the database timezone and stored.
  */
 function date_all_day_date_combo_validate_date_end_alter(&$date, &$form_state, $context) {
-  // If this is an 'All day' value, set the time to midnight.
+  // This hook lets us alter the local date objects created by the date_combo
+  // validation before they are converted back to the database timezone and
+  // stored. If this is an 'All day' value, set the time as close to midnight as
+  // possible.
   if (!empty($context['element']['#date_is_all_day'])) {
-    $date->setTime(0, 0, 0);
+    $increment = isset($context['instance']['widget']['settings']['increment']) ? $context['instance']['widget']['settings']['increment'] : 1;
+    // @todo Should this reduce by an additional 1 minute if the increment is
+    // more than 1? For example, if the increment is 15 should the upper value
+    // be 23:45:59 or 23:44:59?
+    $date->setTime(23, 60 - $increment, 59);
   }
 }
 
 /**
  * Implements hook_field_widget_info_alter().
- *
- * This Field API hook lets us add a new setting to the widgets.
  */
 function date_all_day_field_widget_info_alter(&$info) {
+  // This Field API hook lets us add a new setting to the widgets.
   // Add a setting to a widget type.
   $info['date_select']['settings'] += array(
     'display_all_day' => 0,
@@ -423,12 +418,10 @@ function date_all_day_field_widget_info_alter(&$info) {
 
 /**
  * Implements hook_date_field_widget_settings_form_alter().
- *
- * This hook lets us alter the field settings form by adding a place
- * to set the value added above.
  */
 function date_all_day_date_field_widget_settings_form_alter(&$form, $context) {
-
+  // This hook lets us alter the field settings form by adding a place to set
+  // the value added above.
   $field = $context['field'];
   $instance = $context['instance'];
 
diff --git a/drupal7/sites/all/modules/date/date_all_day/tests/DateAllDayUiTestCase.test b/drupal7/sites/all/modules/date/date_all_day/tests/DateAllDayUiTestCase.test
new file mode 100644
index 00000000..708112c2
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/tests/DateAllDayUiTestCase.test
@@ -0,0 +1,104 @@
+<?php
+
+/**
+ * @file
+ * Test Date All Day functionality.
+ */
+
+/**
+ * Test Date All Day functionality.
+ */
+class DateAllDayUiTestCase extends DateFieldTestBase {
+
+  /**
+   *
+   */
+  public static function getInfo() {
+    return array(
+      'name' => t('Date All Day unit'),
+      'description' => t('Test Date All Day functions.') ,
+      'group' => t('Date'),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_all_day';
+    $modules[] = 'date_all_day_test_feature';
+    parent::setUp($modules);
+
+    // Provide a date format that includes the main values.
+    variable_set('date_format_long', 'D, m/d/Y - H:i');
+
+    // Turn off the option to let users change their timezone, so that all date
+    // values will have a fixed output.
+    variable_set('configurable_timezones', FALSE);
+  }
+
+  /**
+   * Test the node form, confirm the "Date all day" field exists & works.
+   */
+  public function testAllDayField() {
+    // A first node, with the "all day" option disabled.
+    $this->drupalGet('node/add/date-all-day-test');
+    $this->assertResponse(200);
+
+    // Confirm the 'date all day' field exists.
+    $this->assertFieldByName('field_date_all_day[und][0][all_day]');
+    $this->assertFieldByName('field_date_all_day[und][0][value][month]');
+    $this->assertFieldByName('field_date_all_day[und][0][value][day]');
+    $this->assertFieldByName('field_date_all_day[und][0][value][year]');
+    $this->assertFieldByName('field_date_all_day[und][0][value][hour]');
+    $this->assertFieldByName('field_date_all_day[und][0][value][minute]');
+
+    // Submit the node form.
+    $edit = array(
+      'title' => 'Testing the All Day option',
+      'field_date_all_day[und][0][all_day]' => FALSE,
+      'field_date_all_day[und][0][value][month]' => 2,
+      'field_date_all_day[und][0][value][day]' => 11,
+      'field_date_all_day[und][0][value][year]' => 2021,
+      'field_date_all_day[und][0][value][hour]' => 18,
+      'field_date_all_day[und][0][value][minute]' => 15,
+    );
+    $this->drupalPost(NULL, $edit, 'Save');
+    $this->assertResponse(200);
+
+    // Confirm the data is displayed correctly.
+    $this->assertText('Testing the All Day option');
+    $this->assertText('Date All Day');
+    $this->assertText('Thu, 02/11/2021 - 18:15');
+
+    // A second node, this time with the "all day" option enabled.
+    $this->drupalGet('node/add/date-all-day-test');
+    $this->assertResponse(200);
+
+    // Submit the node form.
+    $edit = array(
+      'title' => 'Testing the All Day option again',
+      'field_date_all_day[und][0][all_day]' => TRUE,
+      'field_date_all_day[und][0][value][month]' => 2,
+      'field_date_all_day[und][0][value][day]' => 11,
+      'field_date_all_day[und][0][value][year]' => 2021,
+      'field_date_all_day[und][0][value][hour]' => 18,
+      'field_date_all_day[und][0][value][minute]' => 15,
+    );
+    $this->drupalPost(NULL, $edit, 'Save');
+    $this->assertResponse(200);
+
+    // Confirm the data is displayed correctly.
+    $this->assertText('Testing the All Day option again');
+    $this->assertText('Date All Day');
+    $this->assertText('Thu, 02/11/2021 (All day)');
+
+    // Load the node and confirm the data is as expected.
+    $node = node_load(2);
+    $this->verbose($node);
+    $this->assertEqual($node->title, $edit['title']);
+    $this->assertTrue(isset($node->field_date_all_day[LANGUAGE_NONE][0]['value']));
+    $this->assertEqual($node->field_date_all_day[LANGUAGE_NONE][0]['value'], '2021-02-11 23:45:59');
+  }
+
+}
diff --git a/drupal7/sites/all/modules/date/date_all_day/tests/DateAllDayUpdatesTest.test b/drupal7/sites/all/modules/date/date_all_day/tests/DateAllDayUpdatesTest.test
new file mode 100644
index 00000000..6c54eab8
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/tests/DateAllDayUpdatesTest.test
@@ -0,0 +1,151 @@
+<?php
+
+/**
+ * @file
+ * Test updates for the Date All Day module.
+ */
+
+/**
+ * Test updates for the Date All Day module.
+ */
+class DateAllDayUpdatesTest extends DrupalWebTestCase {
+
+  /**
+   * Define this test class.
+   */
+  public static function getInfo() {
+    return array(
+      'name' => t('Update updates'),
+      'description' => t('Confirm update Date All Day updates works as intended.'),
+      'group' => t('Date'),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_all_day_test_feature';
+    parent::setUp($modules);
+
+    // Error logging.
+    variable_set('error_level', 2);
+
+    // Log in as user 1, so that permissions are irrelevant.
+    $this->loginUser1();
+
+    // Clear the caches so that the field specs are properly loaded.
+    cache_clear_all();
+  }
+
+  /**
+   * Log in as user 1.
+   *
+   * The benefit of doing this is that it ignores permissions entirely, so the
+   * raw functionality can be tested.
+   */
+  protected function loginUser1() {
+    // Load user 1.
+    $account = user_load(1, TRUE);
+
+    // Reset the password.
+    $password = user_password();
+    $edit = array(
+      'pass' => $password,
+    );
+    user_save($account, $edit);
+    $account->pass_raw = $password;
+
+    // Login.
+    $this->drupalLogin($account);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function verbose($message, $title = NULL) {
+    // Handle arrays, objects, etc.
+    if (!is_string($message)) {
+      $message = "<pre>\n" . print_r($message, TRUE) . "\n</pre>\n";
+    }
+
+    // Optional title to go before the output.
+    if (!empty($title)) {
+      $title = '<h2>' . check_plain($title) . "</h2>\n";
+    }
+
+    parent::verbose($title . $message);
+  }
+
+  /**
+   * Test update 7200.
+   */
+  public function testUpdate7200() {
+    // Load the install file, so that the update script is available.
+    module_load_include('install', 'date_all_day');
+    $this->assertEqual(function_exists('date_all_day_update_7200'), TRUE, 'Update 7200 exists.');
+
+    // Create a sample node.
+    $this->drupalGet('node/add/date-all-day-test');
+    $this->assertResponse(200);
+    $this->assertText('Create Date Test');
+
+    $edit = array(
+      'title' => 'Test All Day option',
+      // This field is required.
+      // 'field_datetime_range[und][0][value2][date]' => '2020-09-07 08:00:00',
+      // The All-Day field.
+      'field_date_all_day[und][0][all_day]' => TRUE,
+      'field_date_all_day[und][0][value][year]' => 2020,
+      'field_date_all_day[und][0][value][month]' => 8,
+      'field_date_all_day[und][0][value][day]' => 30,
+    );
+    $this->drupalPost(NULL, $edit, 'Save');
+    $this->assertResponse(200);
+    // Make sure the form submitted.
+    $this->assertNoText('Create Date Test');
+
+    // Load the node.
+    // @todo get the node ID from the URL.
+    $node = node_load(1, NULL, TRUE);
+    $this->verbose($node);
+
+    // Update the field so it's stored the old way.
+    $node->field_date_all_day[LANGUAGE_NONE][0]['value'] = '2020-08-30 00:00:00';
+    node_save($node);
+
+    // Reload the node and confirm that it has the old value stored.
+    $node = node_load($node->nid, NULL, TRUE);
+    $this->verbose($node);
+    $this->assertEqual($node->field_date_all_day[LANGUAGE_NONE][0]['value'], '2020-08-30 00:00:00');
+
+    // Load the code, confirm the data is invalid.
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertResponse(200);
+    $this->assertText($edit['title']);
+    $this->assertText('Date All Day');
+    $this->assertNoText('Sunday, August 30, 2020 (All day)');
+
+    // Load the node's edit form to confirm the values are incorrect.
+    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->assertResponse(200);
+
+    // Execute the update function.
+    $results = date_all_day_update_7200();
+    $this->assertTrue($results);
+    $this->verbose($results);
+
+    // Reload the node and confirm that it has the old value stored.
+    $node = node_load($node->nid, NULL, TRUE);
+    $this->verbose($node);
+    // The expected timestamp is relative to the increment value, which is set
+    // to 15 minutes for this field.
+    $this->assertEqual($node->field_date_all_day[LANGUAGE_NONE][0]['value'], '2020-08-30 23:45:59');
+
+    // Load the node again, confirm the data is now valid.
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertText('Date All Day:');
+    $this->assertText('Sunday, August 30, 2020 (All day)');
+  }
+
+}
diff --git a/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.field_base.inc b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.field_base.inc
new file mode 100644
index 00000000..e3ca1ed7
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.field_base.inc
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * @file
+ * date_all_day_test_feature.features.field_base.inc
+ */
+
+/**
+ * Implements hook_field_default_field_bases().
+ */
+function date_all_day_test_feature_field_default_field_bases() {
+  $field_bases = array();
+
+  // Exported field_base: 'body'.
+  $field_bases['body'] = array(
+    'active' => 1,
+    'cardinality' => 1,
+    'deleted' => 0,
+    'entity_types' => array(
+      0 => 'node',
+    ),
+    'field_name' => 'body',
+    'indexes' => array(
+      'format' => array(
+        0 => 'format',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'text',
+    'settings' => array(),
+    'translatable' => 1,
+    'type' => 'text_with_summary',
+  );
+
+  // Exported field_base: 'field_date_all_day'.
+  $field_bases['field_date_all_day'] = array(
+    'active' => 1,
+    'cardinality' => 1,
+    'deleted' => 0,
+    'entity_types' => array(),
+    'field_name' => 'field_date_all_day',
+    'indexes' => array(
+      'value' => array(
+        0 => 'value',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'date',
+    'settings' => array(
+      'cache_count' => 4,
+      'cache_enabled' => 0,
+      'granularity' => array(
+        'day' => 'day',
+        'hour' => 'hour',
+        'minute' => 'minute',
+        'month' => 'month',
+        'second' => 0,
+        'year' => 'year',
+      ),
+      'repeat' => 0,
+      'timezone_db' => '',
+      'todate' => '',
+      'tz_handling' => 'none',
+    ),
+    'translatable' => 0,
+    'type' => 'datetime',
+  );
+
+  return $field_bases;
+}
diff --git a/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.field_instance.inc b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.field_instance.inc
new file mode 100644
index 00000000..3711363b
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.field_instance.inc
@@ -0,0 +1,123 @@
+<?php
+
+/**
+ * @file
+ * date_all_day_test_feature.features.field_instance.inc
+ */
+
+/**
+ * Implements hook_field_default_field_instances().
+ */
+function date_all_day_test_feature_field_default_field_instances() {
+  $field_instances = array();
+
+  // Exported field_instance: 'node-date_all_day_test-body'.
+  $field_instances['node-date_all_day_test-body'] = array(
+    'bundle' => 'date_all_day_test',
+    'default_value' => NULL,
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'hidden',
+        'module' => 'text',
+        'settings' => array(),
+        'type' => 'text_default',
+        'weight' => 0,
+      ),
+      'teaser' => array(
+        'label' => 'hidden',
+        'module' => 'text',
+        'settings' => array(
+          'trim_length' => 600,
+        ),
+        'type' => 'text_summary_or_trimmed',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'body',
+    'label' => 'Body',
+    'required' => FALSE,
+    'settings' => array(
+      'display_summary' => TRUE,
+      'text_processing' => 1,
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'module' => 'text',
+      'settings' => array(
+        'rows' => 20,
+        'summary_rows' => 5,
+      ),
+      'type' => 'text_textarea_with_summary',
+      'weight' => 1,
+    ),
+  );
+
+  // Exported field_instance: 'node-date_all_day_test-field_date_all_day'.
+  $field_instances['node-date_all_day_test-field_date_all_day'] = array(
+    'bundle' => 'date_all_day_test',
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'module' => 'date',
+        'settings' => array(
+          'custom_date_format' => '',
+          'format_type' => 'long',
+          'fromto' => 'both',
+          'multiple_from' => '',
+          'multiple_number' => '',
+          'multiple_to' => '',
+          'show_remaining_days' => FALSE,
+          'show_repeat_rule' => 'show',
+        ),
+        'type' => 'date_default',
+        'weight' => 8,
+      ),
+      'teaser' => array(
+        'label' => 'above',
+        'settings' => array(),
+        'type' => 'hidden',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'field_date_all_day',
+    'label' => 'Date All Day',
+    'required' => FALSE,
+    'settings' => array(
+      'default_value' => 'now',
+      'default_value2' => 'same',
+      'default_value_code' => '',
+      'default_value_code2' => '',
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'active' => 1,
+      'module' => 'date',
+      'settings' => array(
+        'display_all_day' => 1,
+        'increment' => 15,
+        'input_format' => 'm/d/Y - H:i:s',
+        'input_format_custom' => '',
+        'label_position' => 'above',
+        'no_fieldset' => 0,
+        'repeat_collapsed' => 0,
+        'text_parts' => array(),
+        'year_range' => '-3:+3',
+      ),
+      'type' => 'date_select',
+      'weight' => 9,
+    ),
+  );
+
+  // Translatables
+  // Included for use with string extractors like potx.
+  t('Body');
+  t('Date All Day');
+
+  return $field_instances;
+}
diff --git a/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.inc b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.inc
new file mode 100644
index 00000000..6d5f0faa
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.features.inc
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * @file
+ * date_all_day_test_feature.features.inc
+ */
+
+/**
+ * Implements hook_node_info().
+ */
+function date_all_day_test_feature_node_info() {
+  $items = array(
+    'date_all_day_test' => array(
+      'name' => t('Date Test'),
+      'base' => 'node_content',
+      'description' => t('This content type is used for testing the Date All Day module.'),
+      'has_title' => '1',
+      'title_label' => t('Title'),
+      'help' => '',
+    ),
+  );
+  drupal_alter('node_info', $items);
+  return $items;
+}
diff --git a/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.info b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.info
new file mode 100644
index 00000000..2c5a795d
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.info
@@ -0,0 +1,21 @@
+name = Date All Day Test Feature
+description = Example content type for testing the Date All Day module.
+core = 7.x
+package = Date/Time
+version = 7.78-dev
+dependencies[] = date:date
+dependencies[] = date:date_all_day
+dependencies[] = features:features
+features[features_api][] = api:2
+features[field_base][] = body
+features[field_base][] = field_date_all_day
+features[field_instance][] = node-date_all_day_test-body
+features[field_instance][] = node-date_all_day_test-field_date_all_day
+features[node][] = date_all_day_test
+hidden = 1
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
+core = "7.x"
+project = "date"
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.install b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.install
new file mode 100644
index 00000000..a58edf69
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.install
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * Uninstall functions for the Date All Day Test Feature module.
+ */
+
+/**
+ * Implements hook_uninstall().
+ */
+function date_all_day_test_feature_uninstall() {
+  node_type_delete('date_test_feature');
+  variable_del('node_preview_date_test_feature');
+  node_types_rebuild();
+  menu_rebuild();
+}
diff --git a/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.module b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.module
new file mode 100644
index 00000000..a0b1cfb0
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_all_day/tests/date_all_day_test_feature/date_all_day_test_feature.module
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * Migration integration for Date All Day Test Example.
+ */
+
+include_once 'date_all_day_test_feature.features.inc';
diff --git a/drupal7/sites/all/modules/date/date_api/README.txt b/drupal7/sites/all/modules/date/date_api/README.txt
new file mode 100644
index 00000000..bc28bb7f
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_api/README.txt
@@ -0,0 +1,256 @@
+Date API
+--------
+Once the Date API is installed, all functions in the API are available to be
+used anywhere by any module.
+
+The API uses the PHP 5.2 date functions to create and manipulate dates.
+
+Example, the following will create a date for the local value in one
+timezone, adjust it to a different timezone, then return the offset in seconds
+in the new timezone for the input date; The offset will be adjusted for both
+the timezone difference and daylight savings time, if necessary:
+
+$date = date_create('2007-03-11 02:00:00', timezone_open('America/Chicago'));
+$chicago_time = date_format($date, 'Y-m-d H:i');
+
+print 'At '. $chicago_time .' in Chicago, the timezone offset in seconds
+  was '. date_offset_get($date);
+
+date_timezone_set($date, timezone_open('Europe/Berlin');
+$berlin_time = date_format($date, 'Y-m-d H:i');
+
+print 'It was '. $berlin_time .' in Berlin when it
+  was '. $chicago_time .' in Chicago.';
+print 'At that time in Berlin, the timezone offset in seconds was
+  '. date_offset_get($date);
+
+A helper class is available, new DateObject($string, $timezone, $format), where
+$string is a unixtimestamp, an ISO date, or a string like YYYY-MM-DD HH:MM:SS,
+$timezone is the name of the timezone this date is in, and $format is the format
+of date it is (DATE_FORMAT_UNIX, DATE_FORMAT_ISO, or DATE_FORMAT_DATETIME). It
+creates and return a date object set to the right date and timezone.
+
+Simpletest tests for these functions are included in the package.
+
+Available functions include the following (more documentation is provided in
+the files).
+
+
+Preconfigured arrays
+--------------------------------------------------------------------------------
+Both translated and untranslated values are available.  For example the
+'date_week_days_ordered()' function will shift an array of week day names so it
+starts with the site's first day of the week, otherwise the weekday names start
+with Sunday as the first value, which is the expected order for many php and sql
+functions.
+
+date_month_names();
+date_month_names_abbr();
+date_month_names_untranslated();
+date_week_days();
+date_week_days_abbr();
+date_week_days_untranslated();
+date_week_days_ordered();
+date_years();
+date_hours();
+date_minutes();
+date_seconds();
+date_timezone_names();
+date_timezone_abbr();
+date_timezone_is_valid();
+date_default_timezone();
+date_default_timezone_object();
+date_ampm();
+date_hidden_element();
+date_granularity_names();
+date_granularity_sorted();
+date_granularity_array_from_precision();
+date_granularity_precision();
+date_granularity_format();
+date_now();
+
+
+Miscellaneous date manipulation functions
+--------------------------------------------------------------------------------
+Pre-defined constants and functions that will handle pre-1970 and post-2038
+dates in both PHP 4 and PHP 5, in any OS. Dates can be converted from one
+type to another and date parts can be extracted from any date type.
+
+DATE_DATETIME
+DATE_ISO
+DATE_UNIX
+DATE_ARRAY
+DATE_OBJECT
+DATE_ICAL
+
+date_is_all_day();
+date_increment_round();
+date_is_date();
+date_pad();
+date_has_time();
+date_has_date();
+date_part_format();
+date_limit_format();
+date_nongranularity();
+date_order_translated();
+date_order();
+date_range_valid();
+date_range_years();
+date_range_string();
+date_format_type_options();
+date_example_date();
+date_is_all_day();
+date_increment_round();
+date_make_iso_valid();
+
+
+Date calculation and navigation
+--------------------------------------------------------------------------------
+For example 'date_days_in_month()' identifies the number of days in a month for
+a date.
+
+date_days_in_month();
+date_days_in_year();
+date_iso_weeks_in_year();
+date_iso_week_range();
+date_weeks_in_year();
+date_day_of_week();
+date_day_of_week_name();
+date_week_range();
+date_week();
+date_get_timezone();
+date_get_timezone_db();
+
+
+Date regex and format helpers
+--------------------------------------------------------------------------------
+Pre-defined constants, an array of date format strings and their
+equivalent regex strings.
+
+DATE_REGEX_LOOSE is a very loose regex that will pull date parts out
+of an ISO date with or without separators, using either 'T' or a space
+to separate date and time, and with or without time.
+
+'date_format_date()'' is similar to 'format_date()', except it takes a
+date object instead of a timestamp as the first parameter.
+
+DATE_FORMAT_ISO
+DATE_FORMAT_DATETIME
+DATE_FORMAT_UNIX
+DATE_FORMAT_ICAL
+
+DATE_REGEX_ISO
+DATE_REGEX_DATETIME
+DATE_REGEX_LOOSE
+
+date_format_date();
+date_format_patterns();
+date_format_interval();
+date_format_order();
+date_format_type_options();
+date_type_format();
+
+
+Standardized ical parser and creator
+--------------------------------------------------------------------------------
+The iCal parser is found in 'date_api_ical.inc', which is not included by
+default. Include that file if you want to use these functions:
+
+Complete rewrite of ical imports to parse vevents, vlocations, valarms,
+and all kinds of timezone options and repeat rules for ical imports.
+The function now sticks to parsing the ical into an array that can be used
+in various ways. It no longer trys to convert timezones while parsing instead a
+'date_ical_date()' function is provided that can be used to convert from the
+ical timezone to the local timezone.
+iCal properties can be parsed into an array which other modules can manipulate
+however they like to create additional events from the results.
+The function 'date_api_ical_build_rrule()'' can be used to build an iCal RULE
+from $form_values.
+
+date_ical_import();
+date_ical_parse();
+date_ical_parse_date();
+date_ical_parse_rrule();
+date_ical_parse_exceptions();
+date_ical_parse_duration();
+date_ical_parse_text();
+date_ical_parse_location();
+date_ical_date();
+date_ical_escape_text();
+date_api_ical_build_rrule();
+
+
+Helpers for portable date SQL
+--------------------------------------------------------------------------------
+The SQL functions are found in date_api_sql.inc, which is not included by
+default. Include that file if you want to use these functions:
+
+date_sql_concat();
+date_sql_coalesce();
+date_sql_pad();
+
+
+Date forms and validators
+--------------------------------------------------------------------------------
+Reusable, configurable, self-validating FAPI date elements are found in
+date_api_elements.inc, which is not included by default. Include it if you want
+to use these elements. To use them, create a form element and set the '#type'
+to one of the following:
+
+date_select
+  The date_select element will create a collection of form elements, with a
+  separate select or textfield for each date part. The whole collection will
+  get reformatted back into a date value of the requested type during
+  validation.
+
+date_text
+  The date_text element will create a textfield that can contain a whole date
+  or any part of a date as text. The user input value will be re-formatted back
+  into a date value of the requested type during validation.
+
+date_timezone
+  The date_timezone element will create a drop-down selector to pick a timezone
+  name.
+
+The custom date elements require a few other pieces of information to work
+correctly, like #date_format and #date_type. See the internal documentation
+for more information.
+
+
+Date Repeat API
+--------------------------------------------------------------------------------
+An API for repeating dates is available if installed. It can be used by other
+modules to create a form element that will allow users to select repeat rules
+and store those selections in an iCal RRULE string, and a calculation function
+that will parse the RRULE and return an array of dates that match those rules.
+The API is implemented in the Date module as a new date widget if the Date
+Repeat API is installed.
+
+
+RDF Integration
+--------------------------------------------------------------------------------
+To make RDF easier to use, the base date themes ('date_display_single' and
+'date_display_range') have been expanded so they pass attributes and RDF
+mappings for the field, if any, to the theme. If RDF is installed and no other
+mappings are provided, the theme adds RDF information to mark both the Start
+and End dates as 'xsd:dateTime' datatypes with the property of 'dc:date'. This
+occurs in the theme preprocess layer, in particular via the functions
+'template_preprocess_date_display_single()' and
+'template_preprocess_date_display_range()'.
+
+To mark these as events instead, you could install the schemaorg module [1],
+which will load the schema.org vocabulary. The mark the content type that
+contains events as an 'Event', using the UI exposed by that module and set the
+event start date field with the 'dateStart' property and tag other fields in the
+content type with the appropriate property types. The Date module theme will
+wrap the start and end date output with appropriate markup.
+
+If the result is not quite what you need, you should be able to implement your
+own theme preprocess functions, e.g. 'MYTHEME_preprocess_date_display_single()'
+or 'MYTHEME_preprocess_date_display_range()' and alter the attributes to use the
+values you want.
+
+
+References
+--------------------------------------------------------------------------------
+1: https://www.drupal.org/project/schemaorg
diff --git a/drupal7/sites/all/modules/date/date_api/date-rtl.css b/drupal7/sites/all/modules/date/date_api/date-rtl.css
index deaa9a1c..bee5c4c1 100644
--- a/drupal7/sites/all/modules/date/date_api/date-rtl.css
+++ b/drupal7/sites/all/modules/date/date_api/date-rtl.css
@@ -2,7 +2,8 @@
   margin-left: 0.5em;
   margin-right: 0;
 }
-.container-inline-date .form-item .form-item {
+.container-inline-date .form-item .form-item,
+.date-float {
   float: right;
 }
 
diff --git a/drupal7/sites/all/modules/date/date_api/date.css b/drupal7/sites/all/modules/date/date_api/date.css
index e47a2ae2..d1e79ce0 100644
--- a/drupal7/sites/all/modules/date/date_api/date.css
+++ b/drupal7/sites/all/modules/date/date_api/date.css
@@ -3,7 +3,8 @@
  * Main stylesheet for Date module.
  */
 
-/* Force start/end dates to float using inline-block, where it works, otherwise inline. */
+/* Force start/end dates to float using inline-block, where it works, */
+/* otherwise inline. */
 .container-inline-date {
   clear: both;
 }
@@ -52,7 +53,7 @@ fieldset.date-combo .container-inline-date > .form-item {
   width: auto;
 }
 
-/* The exposed Views form doesn't need some of these styles */
+/* The exposed Views form doesn't need some of these styles. */
 .container-inline-date .date-padding {
   float: left;
 }
@@ -63,7 +64,7 @@ fieldset.date-combo .container-inline-date .date-padding {
   padding: 0;
 }
 
-/* Fixes for date popup css so it will behave in Drupal */
+/* Fixes for date popup css so it will behave in Drupal. */
 #calendar_div,
 #calendar_div td,
 #calendar_div th {
@@ -84,7 +85,7 @@ fieldset.date-combo .container-inline-date .date-padding {
   padding: 0;
 }
 
-/* formatting for start/end dates in nodes and views */
+/* Formatting for start/end dates in nodes and views. */
 span.date-display-single {
 }
 span.date-display-start {
@@ -114,8 +115,8 @@ span.date-display-end {
   width: auto;
 }
 
-/* Add space between date option checkboxes ('All day' & 'Collect End Date') */
-.date-float .form-type-checkbox{
+/* Add space between date option checkboxes ('All day' & 'Collect End Date'). */
+.date-float .form-type-checkbox {
   padding-right: 1em;
 }
 
@@ -142,13 +143,13 @@ span.date-display-end {
   float: left;
 }
 
-/* Calendar day css */
+/* Calendar day CSS. */
 div.date-calendar-day {
-  background: #F3F3F3;
-  border-top: 1px solid #EEE;
-  border-left: 1px solid #EEE;
-  border-right: 1px solid #BBB;
-  border-bottom: 1px solid #BBB;
+  background: #f3f3f3;
+  border-top: 1px solid #eee;
+  border-left: 1px solid #eee;
+  border-right: 1px solid #bbb;
+  border-bottom: 1px solid #bbb;
   color: #999;
   float: left;
   line-height: 1;
@@ -162,7 +163,7 @@ div.date-calendar-day span {
   text-align: center;
 }
 div.date-calendar-day span.month {
-  background-color: #B5BEBE;
+  background-color: #b5bebe;
   color: white;
   font-size: .9em;
   padding: 2px;
@@ -179,9 +180,10 @@ div.date-calendar-day span.year {
 
 .date-form-element-content-multiline {
   padding: 10px;
-  border: 1px solid #CCC;
+  border: 1px solid #ccc;
 }
-/* Admin styling */
+
+/* Admin styling. */
 .form-item.form-item-instance-widget-settings-input-format-custom,
 .form-item.form-item-field-settings-enddate-required {
   margin-left: 1.3em;
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 c537ca04..d453a58a 100644
--- a/drupal7/sites/all/modules/date/date_api/date_api.info
+++ b/drupal7/sites/all/modules/date/date_api/date_api.info
@@ -4,14 +4,15 @@ package = Date/Time
 core = 7.x
 php = 5.2
 
-stylesheets[all][] = date.css
-
 files[] = date_api.module
 files[] = date_api_sql.inc
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+; Test coverage.
+files[] = tests/DateApiTestCase.test
+files[] = tests/DateApiUnitTestCase.test
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date_api/date_api.install b/drupal7/sites/all/modules/date/date_api/date_api.install
index d5a68bbd..2c5a1efa 100644
--- a/drupal7/sites/all/modules/date/date_api/date_api.install
+++ b/drupal7/sites/all/modules/date/date_api/date_api.install
@@ -128,8 +128,8 @@ function date_api_update_7000() {
   // 'date_format_type' table.
   if (db_table_exists('date_format_types')) {
     // Find all the custom entries in the D6 table.
-    $result = db_select('date_format_types', 'old')
-      ->fields('old', array('type', 'title', 'locked'))
+    $result = db_select('date_format_types', 'old_formats')
+      ->fields('old_formats', array('type', 'title', 'locked'))
       ->condition('locked', 0)
       ->execute()
       ->fetchAll(PDO::FETCH_ASSOC);
@@ -138,7 +138,7 @@ function date_api_update_7000() {
     foreach ($result as $row) {
       // See if this value already exists in the new table
       // (it might have been added manually before this update got run).
-      $count = db_select('date_format_type', 'new')
+      $count = db_select('date_format_type', 'new_formats')
         ->condition('type', $row['type'])
         ->countQuery()
         ->execute()
@@ -167,8 +167,8 @@ function date_api_update_7000() {
   // 'd6_date_formats') to the new 'date_formats' table.
   if (db_table_exists('d6_date_formats')) {
     // Find all the custom entries in the D6 table.
-    $result = db_select('d6_date_formats', 'old')
-      ->fields('old', array('format', 'type', 'locked'))
+    $result = db_select('d6_date_formats', 'old_formats')
+      ->fields('old_formats', array('format', 'type', 'locked'))
       ->condition('type', 'custom')
       ->execute()
       ->fetchAll(PDO::FETCH_ASSOC);
@@ -177,7 +177,7 @@ function date_api_update_7000() {
     foreach ($result as $row) {
       // See if this value already exists in the new table (it might have been
       // added manually before this update got run).
-      $count = db_select('date_formats', 'new')
+      $count = db_select('date_formats', 'new_formats')
         ->condition('format', $row['format'])
         ->condition('type', $row['type'])
         ->countQuery()
@@ -205,8 +205,8 @@ function date_api_update_7000() {
   // to 'd6_date_format_locale') to the new 'date_format_locale' table.
   if (db_table_exists('d6_date_format_locale')) {
     // Find all the custom entries in the D6 table.
-    $result = db_select('d6_date_format_locale', 'old')
-      ->fields('old', array('format', 'type', 'language'))
+    $result = db_select('d6_date_format_locale', 'old_formats')
+      ->fields('old_formats', array('format', 'type', 'language'))
       ->condition('type', 'custom')
       ->execute()
       ->fetchAll(PDO::FETCH_ASSOC);
@@ -215,7 +215,7 @@ function date_api_update_7000() {
     foreach ($result as $row) {
       // See if this value already exists in the new table (it might have been
       // added manually before this update got run).
-      $count = db_select('date_format_locale', 'new')
+      $count = db_select('date_format_locale', 'new_formats')
         ->condition('format', $row['format'])
         ->condition('type', $row['type'])
         ->condition('language', $row['language'])
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 160bc9fb..49129b16 100644
--- a/drupal7/sites/all/modules/date/date_api/date_api.module
+++ b/drupal7/sites/all/modules/date/date_api/date_api.module
@@ -3,9 +3,10 @@
 /**
  * @file
  * This module will make the date API available to other modules.
- * Designed to provide a light but flexible assortment of functions
- * and constants, with more functionality in additional files that
- * are not loaded unless other modules specifically include them.
+ *
+ * Designed to provide a light but flexible assortment of functions and
+ * constants, with more functionality in additional files that are not loaded
+ * unless other modules specifically include them.
  */
 
 /**
@@ -14,9 +15,9 @@
  * Includes standard date types, format strings, strict regex strings for ISO
  * and DATETIME formats (seconds are optional).
  *
- * The loose regex will find any variety of ISO date and time, with or
- * without time, with or without dashes and colons separating the elements,
- * and with either a 'T' or a space separating date and time.
+ * The loose regex will find any variety of ISO date and time, with or without
+ * time, with or without dashes and colons separating the elements, and with
+ * either a 'T' or a space separating date and time.
  */
 define('DATE_ISO', 'date');
 define('DATE_UNIX', 'datestamp');
@@ -68,7 +69,6 @@ function date_help($path, $arg) {
       $output .= '<h2>More Information</h2><p>' . t('Complete documentation for the Date and Date API modules is available at <a href="@link">http://drupal.org/node/92460</a>.', array('@link' => 'http://drupal.org/node/262062')) . '</p>';
 
       return $output;
-
   }
 }
 
@@ -108,16 +108,14 @@ function date_api_status() {
   }
 
   return array('errors', $error_messages, 'success' => $success_messages);
-
 }
 
 /**
  * Implements hook_menu().
- *
- * Creates a 'Date API' section on the administration page for Date
- * modules to use for their configuration and settings.
  */
 function date_api_menu() {
+  // Creates a 'Date API' section on the administration page for Date modules
+  // to use for their configuration and settings.
   $items['admin/config/date'] = array(
     'title' => 'Date API',
     'description' => 'Settings for modules the use the Date API.',
@@ -132,8 +130,10 @@ function date_api_menu() {
 }
 
 /**
- * Extend PHP DateTime class with granularity handling, merge functionality and
- * slightly more flexible initialization parameters.
+ * Extend PHP DateTime class.
+ *
+ * Adds granularity handling, merge functionality and slightly more flexible
+ * initialization parameters.
  *
  * This class is a Drupal independent extension of the >= PHP 5.2 DateTime
  * class.
@@ -150,7 +150,7 @@ class DateObject extends DateTime {
     'hour',
     'minute',
     'second',
-    'timezone'
+    'timezone',
   );
   private $serializedTime;
   private $serializedTimezone;
@@ -221,7 +221,7 @@ class DateObject extends DateTime {
     // Special handling for Unix timestamps expressed in the local timezone.
     // Create a date object in UTC and convert it to the local timezone. Don't
     // try to turn things like '2010' with a format of 'Y' into a timestamp.
-    if (is_numeric($time) && (empty($format) || $format == 'U')) {
+    if (!is_array($time) && ctype_digit((string)$time) && (empty($format) || $format == 'U')) {
       // Assume timestamp.
       $time = "@" . $time;
       $date = new DateObject($time, 'UTC');
@@ -294,7 +294,8 @@ class DateObject extends DateTime {
       if (preg_match('/[a-zA-Z]/', $tz->getName())) {
         $this->setTimezone($tz);
       }
-      // We have no information about the timezone so must fallback to a default.
+      // We have no information about the timezone so must fallback to a
+      // default.
       else {
         $this->setTimezone(new DateTimeZone("UTC"));
         $this->errors['timezone'] = t('No valid timezone name was provided.');
@@ -305,13 +306,13 @@ class DateObject extends DateTime {
   /**
    * Merges two date objects together using the current date values as defaults.
    *
-   * @param object $other
+   * @param DateObject $other
    *   Another date object to merge with.
    *
-   * @return object
+   * @return DateObject
    *   A merged date object.
    */
-  public function merge(FeedsDateTime $other) {
+  public function merge(DateObject $other) {
     $other_tz = $other->getTimezone();
     $this_tz = $this->getTimezone();
     // Figure out which timezone to use for combination.
@@ -378,14 +379,14 @@ class DateObject extends DateTime {
    * Overrides base format function, formats this date according to its
    * available granularity, unless $force'ed not to limit to granularity.
    *
-   * @TODO Add translation into this so translated names will be provided.
+   * @todo Add translation into this so translated names will be provided.
    *
    * @param string $format
    *   A date format string.
    * @param bool $force
    *   Whether or not to limit the granularity. Defaults to FALSE.
    *
-   * @return string|false
+   * @return string|bool
    *   Returns the formatted date string on success or FALSE on failure.
    */
   public function format($format, $force = FALSE) {
@@ -465,15 +466,16 @@ class DateObject extends DateTime {
   public function validGranularity($granularity = NULL, $flexible = FALSE) {
     $true = $this->hasGranularity() && (!$granularity || $flexible || $this->hasGranularity($granularity));
     if (!$true && $granularity) {
+      $allowed_values = array(
+        'second',
+        'minute',
+        'hour',
+        'day',
+        'month',
+        'year',
+      );
       foreach ((array) $granularity as $part) {
-        if (!$this->hasGranularity($part) && in_array($part, array(
-          'second',
-          'minute',
-          'hour',
-          'day',
-          'month',
-          'year')
-        )) {
+        if (!$this->hasGranularity($part) && in_array($part, $allowed_values)) {
           switch ($part) {
             case 'second':
               $this->errors[$part] = t('The second is missing.');
@@ -536,7 +538,7 @@ class DateObject extends DateTime {
    * @param array $granularity
    *   An array of date parts.
    */
-  public function limitGranularity($granularity) {
+  public function limitGranularity(array $granularity) {
     foreach ($this->granularity as $key => $val) {
       if ($val != 'timezone' && !in_array($val, $granularity)) {
         unset($this->granularity[$key]);
@@ -615,10 +617,16 @@ class DateObject extends DateTime {
     $regex1 = str_replace('a', '(.)', $regex1);
     preg_match('`^' . $regex1 . '$`', stripslashes($format), $letters);
     array_shift($letters);
-    // Extract values.
-    $regex2 = preg_replace($patterns, $repl2, $format_regexp, 1);
-    $regex2 = str_replace('A', '(AM|PM)', $regex2);
-    $regex2 = str_replace('a', '(am|pm)', $regex2);
+
+    $ampm_upper = date_ampm_options(FALSE, TRUE);
+    $ampm_lower = date_ampm_options(FALSE, FALSE);
+    $regex2 = strtr(
+      preg_replace($patterns, $repl2, $format_regexp, 1),
+      array(
+        'A' => '(' . preg_quote($ampm_upper['am'], '`') . '|' . preg_quote($ampm_upper['pm'], '`') . ')',
+        'a' => '(' . preg_quote($ampm_lower['am'], '`') . '|' . preg_quote($ampm_lower['pm'], '`') . ')',
+      )
+    );
     preg_match('`^' . $regex2 . '$`u', $date, $values);
     array_shift($values);
     // If we did not find all the values for the patterns in the format, abort.
@@ -678,8 +686,11 @@ class DateObject extends DateTime {
           break;
 
         case 'a':
+          $ampm = ($value == $ampm_lower['am'] ? 'am' : 'pm');
+          break;
+
         case 'A':
-          $ampm = strtolower($value);
+          $ampm = ($value == $ampm_upper['am'] ? 'am' : 'pm');
           break;
 
         case 'g':
@@ -712,11 +723,14 @@ class DateObject extends DateTime {
 
       }
     }
-    if (isset($ampm) && $ampm == 'pm' && $final_date['hour'] < 12) {
-      $final_date['hour'] += 12;
-    }
-    elseif (isset($ampm) && $ampm == 'am' && $final_date['hour'] == 12) {
-      $final_date['hour'] -= 12;
+
+    if (isset($ampm)) {
+      if ($ampm == 'pm' && $final_date['hour'] < 12) {
+        $final_date['hour'] += 12;
+      }
+      elseif ($ampm == 'am' && $final_date['hour'] == 12) {
+        $final_date['hour'] -= 12;
+      }
     }
 
     // Blank becomes current time, given TZ.
@@ -797,7 +811,7 @@ class DateObject extends DateTime {
    *   (optional) Whether to force a full date by filling in missing values.
    *   Defaults to FALSE.
    */
-  public function toISO($arr, $full = FALSE) {
+  public function toISO(array $arr, $full = FALSE) {
     // Add empty values to avoid errors. The empty values must create a valid
     // date or we will get date slippage, i.e. a value of 2011-00-00 will get
     // interpreted as November of 2010 by PHP.
@@ -933,7 +947,7 @@ class DateObject extends DateTime {
    * @return array
    *   An array of error messages, keyed by date part.
    */
-  public function arrayErrors($arr) {
+  public function arrayErrors(array $arr) {
     $errors = array();
     $now = date_now();
     $default_month = !empty($arr['month']) ? $arr['month'] : $now->format('n');
@@ -998,8 +1012,8 @@ class DateObject extends DateTime {
   public function difference($date2_in, $measure = 'seconds', $absolute = TRUE) {
     // Create cloned objects or original dates will be impacted by the
     // date_modify() operations done in this code.
-    $date1 = clone($this);
-    $date2 = clone($date2_in);
+    $date1 = clone $this;
+    $date2 = clone $date2_in;
     if (is_object($date1) && is_object($date2)) {
       $diff = date_format($date2, 'U') - date_format($date1, 'U');
       if ($diff == 0) {
@@ -1086,6 +1100,7 @@ class DateObject extends DateTime {
     }
     return NULL;
   }
+
 }
 
 /**
@@ -1102,8 +1117,8 @@ class DateObject extends DateTime {
  * @return bool
  *   TRUE if the element is effectively hidden, FALSE otherwise.
  */
-function date_hidden_element($element) {
-  // @TODO What else needs to be tested to see if dates are hidden or disabled?
+function date_hidden_element(array $element) {
+  // @todo What else needs to be tested to see if dates are hidden or disabled?
   if ((isset($element['#access']) && empty($element['#access']))
     || !empty($element['#programmed'])
     || in_array($element['#type'], array('hidden', 'value'))) {
@@ -1286,7 +1301,6 @@ function date_week_days_abbr($required = FALSE, $refresh = TRUE, $length = 3) {
 
     default:
       $context = '';
-      break;
   }
   foreach (date_week_days_untranslated() as $key => $day) {
     $weekdays[$key] = t(substr($day, 0, $length), array(), array('context' => $context));
@@ -1304,7 +1318,7 @@ function date_week_days_abbr($required = FALSE, $refresh = TRUE, $length = 3) {
  * @return array
  *   An array of weekdays reordered to match the first day of the week.
  */
-function date_week_days_ordered($weekdays) {
+function date_week_days_ordered(array $weekdays) {
   $first_day = variable_get('date_first_day', 0);
   if ($first_day > 0) {
     for ($i = 1; $i <= $first_day; $i++) {
@@ -1459,12 +1473,38 @@ function date_seconds($format = 's', $required = FALSE, $increment = 1) {
  *   An array of AM and PM options.
  */
 function date_ampm($required = FALSE) {
-  $none = array('' => '');
-  $ampm = array(
-    'am' => t('am', array(), array('context' => 'ampm')),
-    'pm' => t('pm', array(), array('context' => 'ampm')),
-  );
-  return !$required ? $none + $ampm : $ampm;
+  $ampm = date_ampm_options(FALSE, FALSE);
+
+  return !$required ? array('' => '') + $ampm : $ampm;
+}
+
+/**
+ * Constructs an array of AM and PM options without empty option.
+ *
+ * @param bool $key_upper
+ *   If TRUE then the array key will be uppercase.
+ * @param bool $label_upper
+ *   If TRUE then the array value will be uppercase.
+ *
+ * @return array
+ *   An array of AM and PM options.
+ */
+function date_ampm_options($key_upper, $label_upper) {
+  $am = $key_upper ? 'AM' : 'am';
+  $pm = $key_upper ? 'PM' : 'pm';
+
+  if ($label_upper) {
+    return array(
+      $am => t('AM', array(), array('context' => 'ampm')),
+      $pm => t('PM', array(), array('context' => 'ampm')),
+    );
+  }
+  else {
+    return array(
+      $am => t('am', array(), array('context' => 'ampm')),
+      $pm => t('pm', array(), array('context' => 'ampm')),
+    );
+  }
 }
 
 /**
@@ -1543,7 +1583,7 @@ function date_granularity_names() {
  * @param array $granularity
  *   An array of date parts.
  */
-function date_granularity_sorted($granularity) {
+function date_granularity_sorted(array $granularity) {
   return array_intersect(array(
     'year',
     'month',
@@ -1596,7 +1636,7 @@ function date_granularity_array_from_precision($precision) {
  * @return string
  *   The most precise element in a granularity array.
  */
-function date_granularity_precision($granularity_array) {
+function date_granularity_precision(array $granularity_array) {
   $input = date_granularity_sorted($granularity_array);
   return array_pop($input);
 }
@@ -1837,7 +1877,6 @@ function date_format_interval($date, $granularity = 2, $display_ago = TRUE) {
  *   (optional) PHP DateTimeZone object, string or NULL allowed. Optionally
  *   force time to a specific timezone, defaults to user timezone, if set,
  *   otherwise site timezone. Defaults to NULL.
- *
  * @param bool $reset
  *   (optional) Static cache reset.
  *
@@ -1845,10 +1884,12 @@ function date_format_interval($date, $granularity = 2, $display_ago = TRUE) {
  *   The current time as a date object.
  */
 function date_now($timezone = NULL, $reset = FALSE) {
-  $static_var = __FUNCTION__ . $timezone;
   if ($timezone instanceof DateTimeZone) {
     $static_var = __FUNCTION__ . $timezone->getName();
   }
+  else {
+    $static_var = __FUNCTION__ . $timezone;
+  }
 
   if ($reset) {
     drupal_static_reset($static_var);
@@ -1861,7 +1902,7 @@ function date_now($timezone = NULL, $reset = FALSE) {
   }
 
   // Avoid unexpected manipulation of cached $now object
-  // by subsequent code execution
+  // by subsequent code execution.
   // @see https://drupal.org/node/2261395
   $clone = clone $now;
   return $clone;
@@ -2060,8 +2101,8 @@ function date_week_range($week, $year) {
   date_modify($min_date, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
 
   // Move forwards to the last day of the week.
-  $max_date = clone($min_date);
-  date_modify($max_date, '+6 days');
+  $max_date = clone $min_date;
+  date_modify($max_date, '+6 days +23 hours +59 minutes +59 seconds');
 
   if (date_format($min_date, 'Y') != $year) {
     $min_date = new DateObject($year . '-01-01 00:00:00');
@@ -2097,8 +2138,8 @@ function date_iso_week_range($week, $year) {
   }
 
   // Move forwards to the last day of the week.
-  $max_date = clone($min_date);
-  date_modify($max_date, '+6 days');
+  $max_date = clone $min_date;
+  date_modify($max_date, '+6 days +23 hours +59 minutes +59 seconds');
   return array($min_date, $max_date);
 }
 
@@ -2148,7 +2189,7 @@ function date_week($date) {
 
   // Remove the leap week if it's present.
   if ($date_year > intval($parts[0])) {
-    $last_date = clone($date);
+    $last_date = clone $date;
     date_modify($last_date, '-7 days');
     $week = date_format($last_date, 'W') + 1;
   }
@@ -2202,7 +2243,7 @@ function date_pad($value, $size = 2) {
  * @return bool
  *   TRUE if the granularity contains a time portion, FALSE otherwise.
  */
-function date_has_time($granularity) {
+function date_has_time(array $granularity) {
   if (!is_array($granularity)) {
     $granularity = array();
   }
@@ -2219,7 +2260,7 @@ function date_has_time($granularity) {
  * @return bool
  *   TRUE if the granularity contains a date portion, FALSE otherwise.
  */
-function date_has_date($granularity) {
+function date_has_date(array $granularity) {
   if (!is_array($granularity)) {
     $granularity = array();
   }
@@ -2266,7 +2307,7 @@ function date_part_format($part, $format) {
  * @return string
  *   The format string with all other elements removed.
  */
-function date_limit_format($format, $granularity) {
+function date_limit_format($format, array $granularity) {
   // Use the advanced drupal_static() pattern to improve performance.
   static $drupal_static_fast;
   if (!isset($drupal_static_fast)) {
@@ -2436,12 +2477,12 @@ function date_format_order($format) {
  * Strips out unwanted granularity elements.
  *
  * @param array $granularity
- *   An array like ('year', 'month', 'day', 'hour', 'minute', 'second');
+ *   An array like ('year', 'month', 'day', 'hour', 'minute', 'second').
  *
  * @return array
  *   A reduced set of granularitiy elements.
  */
-function date_nongranularity($granularity) {
+function date_nongranularity(array $granularity) {
   $options = array(
     'year',
     'month',
@@ -2473,7 +2514,10 @@ function date_api_theme($existing, $type, $theme, $path) {
   return array(
     'date_nav_title' => $base + array(
       'variables' => array(
-        'granularity' => NULL, 'view' => NULL, 'link' => NULL, 'format' => NULL
+        'granularity' => NULL,
+        'view' => NULL,
+        'link' => NULL,
+        'format' => NULL,
       ),
     ),
     'date_timezone' => $base + array('render element' => 'element'),
@@ -2497,7 +2541,9 @@ function date_api_theme($existing, $type, $theme, $path) {
     'date_calendar_day' => $base + array('variables' => array('date' => NULL)),
     'date_time_ago' => $base + array(
       'variables' => array(
-        'start_date' => NULL, 'end_date' => NULL, 'interval' => NULL
+        'start_date' => NULL,
+        'end_date' => NULL,
+        'interval' => NULL,
       ),
     ),
   );
@@ -2562,7 +2608,6 @@ function date_get_timezone_db($handling, $timezone = NULL) {
     case ('none'):
     default:
       $timezone = date_default_timezone();
-      break;
   }
   return $timezone;
 }
@@ -2679,7 +2724,7 @@ function date_range_years($string, $date = NULL) {
  * @return string
  *   A min and max year string like '-3:+1'.
  */
-function date_range_string($years) {
+function date_range_string(array $years) {
   $this_year = date_format(date_now(), 'Y');
 
   if ($years[0] < $this_year) {
@@ -2776,21 +2821,32 @@ function date_example_date() {
  * @param string $string2
  *   A string date in datetime format for the 'end' date.
  * @param string $granularity
- *   (optional) The granularity of the date. Defaults to 'second'.
+ *   (optional) The granularity of the date. Allowed values are:
+ *   - 'second' (default)
+ *   - 'minute'
+ *   - 'hour'
  * @param int $increment
- *   (optional) The increment of the date. Defaults to 1.
+ *   (optional) The increment of the date. Only allows positive integers.
+ *   Defaults to 1.
  *
  * @return bool
  *   TRUE if the date is all day, FALSE otherwise.
  */
 function date_is_all_day($string1, $string2, $granularity = 'second', $increment = 1) {
+  // Both date strings must be present.
   if (empty($string1) || empty($string2)) {
     return FALSE;
   }
+  // The granularity argument only allows three options.
   elseif (!in_array($granularity, array('hour', 'minute', 'second'))) {
     return FALSE;
   }
+  // The increment must be an integer.
+  elseif (!is_int($increment) || $increment === 0) {
+    return FALSE;
+  }
 
+  // Verify the first date argument is a valid date string.
   preg_match('/([0-9]{4}-[0-9]{2}-[0-9]{2}) (([0-9]{2}):([0-9]{2}):([0-9]{2}))/', $string1, $matches);
   $count = count($matches);
   $date1 = $count > 1 ? $matches[1] : '';
@@ -2798,6 +2854,11 @@ function date_is_all_day($string1, $string2, $granularity = 'second', $increment
   $hour1 = $count > 3 ? intval($matches[3]) : 0;
   $min1 = $count > 4 ? intval($matches[4]) : 0;
   $sec1 = $count > 5 ? intval($matches[5]) : 0;
+  if (empty($date1) || empty($time1)) {
+    return FALSE;
+  }
+
+  // Verify the second date argument is a valid date string.
   preg_match('/([0-9]{4}-[0-9]{2}-[0-9]{2}) (([0-9]{2}):([0-9]{2}):([0-9]{2}))/', $string2, $matches);
   $count = count($matches);
   $date2 = $count > 1 ? $matches[1] : '';
@@ -2805,10 +2866,7 @@ function date_is_all_day($string1, $string2, $granularity = 'second', $increment
   $hour2 = $count > 3 ? intval($matches[3]) : 0;
   $min2 = $count > 4 ? intval($matches[4]) : 0;
   $sec2 = $count > 5 ? intval($matches[5]) : 0;
-  if (empty($date1) || empty($date2)) {
-    return FALSE;
-  }
-  if (empty($time1) || empty($time2)) {
+  if (empty($date2) || empty($time2)) {
     return FALSE;
   }
 
@@ -2817,31 +2875,25 @@ function date_is_all_day($string1, $string2, $granularity = 'second', $increment
   $tmp = date_minutes('i', TRUE, $increment);
   $max_minutes = intval(array_pop($tmp));
 
-  // See if minutes and seconds are the maximum allowed for an increment or the
+  // See if minutes and seconds are the maximum allowed for an increment, or the
   // maximum possible (59), or 0.
   switch ($granularity) {
     case 'second':
-      $min_match = $time1 == '00:00:00'
-        || ($hour1 == 0 && $min1 == 0 && $sec1 == 0);
-      $max_match = $time2 == '00:00:00'
-        || ($hour2 == 23 && in_array($min2, array($max_minutes, 59)) && in_array($sec2, array($max_seconds, 59)))
-        || ($hour1 == 0 && $hour2 == 0 && $min1 == 0 && $min2 == 0 && $sec1 == 0 && $sec2 == 0);
+      $min_match = ($hour1 == 0 && $min1 == 0 && $sec1 == 0);
+      $max_match = ($hour2 == 23 && in_array($min2, array($max_minutes, 59)) && in_array($sec2, array($max_seconds, 59)))
+        || ($date1 != $date2 && $hour1 == 0 && $hour2 == 0 && $min1 == 0 && $min2 == 0 && $sec1 == 0 && $sec2 == 0);
       break;
 
     case 'minute':
-      $min_match = $time1 == '00:00:00'
-        || ($hour1 == 0 && $min1 == 0);
-      $max_match = $time2 == '00:00:00'
-        || ($hour2 == 23 && in_array($min2, array($max_minutes, 59)))
-        || ($hour1 == 0 && $hour2 == 0 && $min1 == 0 && $min2 == 0);
+      $min_match = ($hour1 == 0 && $min1 == 0);
+      $max_match = ($hour2 == 23 && in_array($min2, array($max_minutes, 59)))
+        || ($date1 != $date2 && $hour1 == 0 && $hour2 == 0 && $min1 == 0 && $min2 == 0);
       break;
 
     case 'hour':
-      $min_match = $time1 == '00:00:00'
-        || ($hour1 == 0);
-      $max_match = $time2 == '00:00:00'
-        || ($hour2 == 23)
-        || ($hour1 == 0 && $hour2 == 0);
+      $min_match = ($hour1 == 0);
+      $max_match = ($hour2 == 23)
+        || ($date1 != $date2 && $hour1 == 0 && $hour2 == 0);
       break;
 
     default:
@@ -2907,9 +2959,10 @@ function date_is_date($date) {
  * Replace specific ISO values using patterns.
  *
  * Function will replace ISO values that have the pattern 9999-00-00T00:00:00
- * with a pattern like 9999-01-01T00:00:00, to match the behavior of non-ISO dates
- * and ensure that date objects created from this value contain a valid month
- * and day.
+ * with a pattern like 9999-01-01T00:00:00, to match the behavior of non-ISO
+ * dates and ensure that date objects created from this value contain a valid
+ * month and day.
+ *
  * Without this fix, the ISO date '2020-00-00T00:00:00' would be created as
  * November 30, 2019 (the previous day in the previous month).
  *
@@ -2919,7 +2972,7 @@ function date_is_date($date) {
  * @return mixed|string
  *   replaced value, or incoming value.
  *
- * @TODO Expand on this to work with all sorts of partial ISO dates.
+ * @todo Expand on this to work with all sorts of partial ISO dates.
  */
 function date_make_iso_valid($iso_string) {
   // If this isn't a value that uses an ISO pattern, there is nothing to do.
diff --git a/drupal7/sites/all/modules/date/date_api/date_api_elements.inc b/drupal7/sites/all/modules/date/date_api/date_api_elements.inc
index 638fcda5..f4035d7d 100644
--- a/drupal7/sites/all/modules/date/date_api/date_api_elements.inc
+++ b/drupal7/sites/all/modules/date/date_api/date_api_elements.inc
@@ -3,11 +3,12 @@
 /**
  * @file
  * Date API elements themes and validation.
+ *
  * This file is only included during the edit process to reduce memory usage.
  */
 
 /**
- * Implements hook_element_info().
+ * Wrapper for hook_element_info().
  *
  * Parameters for date form elements, designed to have sane defaults so any
  * or all can be omitted.
@@ -65,7 +66,8 @@
  */
 function _date_api_element_info() {
   $date_base = array(
-    '#input' => TRUE, '#tree' => TRUE,
+    '#input' => TRUE,
+    '#tree' => TRUE,
     '#date_timezone' => date_default_timezone(),
     '#date_flexible' => 0,
     '#date_format' => variable_get('date_format_short', 'm/d/Y - H:i'),
@@ -88,7 +90,8 @@ function _date_api_element_info() {
     '#value_callback' => 'date_text_element_value_callback',
   ));
   $type['date_timezone'] = array(
-    '#input' => TRUE, '#tree' => TRUE,
+    '#input' => TRUE,
+    '#tree' => TRUE,
     '#process' => array('date_timezone_element_process'),
     '#theme_wrappers' => array('date_text'),
     '#value_callback' => 'date_timezone_element_value_callback',
@@ -105,7 +108,7 @@ function _date_api_element_info() {
 /**
  * Create a date object from a datetime string value.
  */
-function date_default_date($element) {
+function date_default_date(array $element) {
   $granularity = date_format_order($element['#date_format']);
   $default_value = $element['#default_value'];
   $format = DATE_FORMAT_DATETIME;
@@ -270,7 +273,7 @@ function date_timezone_element_process($element, &$form_state, $form) {
 /**
  * Validation for timezone input.
  *
- *  Move the timezone value from the nested field back to the original field.
+ * Move the timezone value from the nested field back to the original field.
  */
 function date_timezone_validate($element, &$form_state) {
   if (date_hidden_element($element)) {
@@ -287,10 +290,10 @@ function date_text_element_value_callback($element, $input = FALSE, &$form_state
   $return = array('date' => '');
   $date = NULL;
 
-  // Normal input from submitting the form element.
-  // Check is_array() to skip the string input values created by Views pagers.
-  // Those string values, if present, should be interpreted as empty input.
-  if ($input != FALSE && is_array($input)) {
+  // Normal input from submitting the form element. Check is_array() to skip
+  // the string input values created by Views pagers. Those string values, if
+  // present, should be interpreted as empty input.
+  if ($input !== FALSE && is_array($input) && !is_null($input['date'])) {
     $return = $input;
     $date = date_text_input_date($element, $input);
   }
@@ -309,8 +312,8 @@ function date_text_element_value_callback($element, $input = FALSE, &$form_state
  *
  * Display all or part of a date in a single textfield.
  *
- * The exact parts displayed in the field are those in #date_granularity.
- * The display of each part comes from #date_format.
+ * The exact parts displayed in the field are those in #date_granularity. The
+ * display of each part comes from #date_format.
  */
 function date_text_element_process($element, &$form_state, $form) {
   if (date_hidden_element($element)) {
@@ -326,9 +329,10 @@ function date_text_element_process($element, &$form_state, $form) {
   $now = date_example_date();
   $element['date']['#title'] = t('Date');
   $element['date']['#title_display'] = 'invisible';
-  $element['date']['#description'] = ' ' . t('Format: @date', array(
-    '@date' => date_format_date(date_example_date(), 'custom', $element['#date_format']
-  )));
+  $date_args = array(
+    '@date' => date_format_date(date_example_date(), 'custom', $element['#date_format']),
+  );
+  $element['date']['#description'] = ' ' . t('Format: @date', $date_args);
   $element['date']['#ajax'] = !empty($element['#ajax']) ? $element['#ajax'] : FALSE;
 
   // Make changes if instance is set to be rendered as a regular field.
@@ -338,9 +342,8 @@ function date_text_element_process($element, &$form_state, $form) {
     $element['date']['#required'] = $element['#required'];
   }
 
-  // Keep the system from creating an error message for the sub-element.
-  // We'll set our own message on the parent element.
-  // $element['date']['#required'] = $element['#required'];
+  // Keep the system from creating an error message for the sub-element. We'll
+  // set our own message on the parent element.
   $element['date']['#theme'] = 'date_textfield_element';
   if (isset($element['#element_validate'])) {
     array_push($element['#element_validate'], 'date_text_validate');
@@ -363,9 +366,9 @@ function date_text_element_process($element, &$form_state, $form) {
 /**
  * Validation for text input.
  *
- * When used as a Views widget, the validation step always gets triggered,
- * even with no form submission. Before form submission $element['#value']
- * contains a string, after submission it contains an array.
+ * When used as a Views widget, the validation step always gets triggered, even
+ * with no form submission. Before form submission $element['#value'] contains a
+ * string, after submission it contains an array.
  */
 function date_text_validate($element, &$form_state) {
   if (date_hidden_element($element)) {
@@ -388,9 +391,9 @@ function date_text_validate($element, &$form_state) {
   $label = !empty($element['#date_title']) ? $element['#date_title'] : (!empty($element['#title']) ? $element['#title'] : '');
   $date = date_text_input_date($element, $input);
 
-  // If the field has errors, display them.
-  // If something was input but there is no date, the date is invalid.
-  // If the field is empty and required, set error message and return.
+  // If the field has errors, display them. If something was input but there is
+  // no date, the date is invalid. If the field is empty and required, set
+  // error message and return.
   $error_field = implode('][', $element['#parents']);
   if (empty($date) || !empty($date->errors)) {
     if (is_object($date) && !empty($date->errors)) {
@@ -464,7 +467,12 @@ function date_select_element_value_callback($element, $input = FALSE, &$form_sta
   );
   foreach ($granularity as $field) {
     if ($field != 'timezone') {
-      $return[$field] = date_is_date($date) ? $date->format($formats[$field]) : '';
+      if (date_is_date($date)) {
+        $return[$field] = $date->format($formats[$field]);
+      }
+      else {
+        $return = array();
+      }
     }
   }
   return $return;
@@ -488,7 +496,7 @@ function date_select_element_process($element, &$form_state, $form) {
   $date = NULL;
   $granularity = date_format_order($element['#date_format']);
 
-  if (is_array($element['#default_value'])) {
+  if (array_key_exists('#default_value', $element) && is_array($element['#default_value'])) {
     $date = date_select_input_date($element, $element['#default_value']);
   }
   elseif (!empty($element['#default_value'])) {
@@ -536,11 +544,10 @@ function date_select_element_process($element, &$form_state, $form) {
 /**
  * Creates form elements for one or more date parts.
  *
- * Get the order of date elements from the provided format.
- * If the format order omits any date parts in the granularity, alter the
- * granularity array to match the format, then flip the $order array
- * to get the position for each element. Then iterate through the
- * elements and create a sub-form for each part.
+ * Get the order of date elements from the provided format. If the format order
+ * omits any date parts in the granularity, alter the granularity array to match
+ * the format, then flip the $order array to get the position for each element.
+ * Then iterate through the elements and create a sub-form for each part.
  *
  * @param array $element
  *   The date element.
@@ -552,13 +559,13 @@ function date_select_element_process($element, &$form_state, $form) {
  * @return array
  *   The form array for the submitted date parts.
  */
-function date_parts_element($element, $date, $format) {
+function date_parts_element(array $element, $date, $format) {
   $granularity = date_format_order($format);
   $sub_element = array('#granularity' => $granularity);
   $order = array_flip($granularity);
 
-  $hours_format  = strpos(strtolower($element['#date_format']), 'a') ? 'g' : 'G';
-  $month_function  = strpos($element['#date_format'], 'F') !== FALSE ? 'date_month_names' : 'date_month_names_abbr';
+  $hours_format = strpos(strtolower($element['#date_format']), 'a') ? 'g' : 'G';
+  $month_function = strpos($element['#date_format'], 'F') !== FALSE ? 'date_month_names' : 'date_month_names_abbr';
   $count = 0;
   $increment = min(intval($element['#date_increment']), 1);
 
@@ -634,7 +641,8 @@ function date_parts_element($element, $date, $format) {
       if ($element['#date_label_position'] == 'within') {
         if (!empty($sub_element[$field]['#options']) && is_array($sub_element[$field]['#options'])) {
           $sub_element[$field]['#options'] = array(
-            '-' . $label => '-' . $label) + $sub_element[$field]['#options'];
+            '-' . $label => '-' . $label,
+          ) + $sub_element[$field]['#options'];
         }
         if (empty($sub_element[$field]['#default_value'])) {
           $sub_element[$field]['#default_value'] = '-' . $label;
@@ -648,14 +656,15 @@ function date_parts_element($element, $date, $format) {
       $sub_element[$field]['#title_display'] = in_array($element['#date_label_position'], array('within', 'none')) ? 'invisible' : 'before';
       if ($element['#date_label_position'] == 'within') {
         $sub_element[$field]['#options'] = array(
-          '' => '-' . $label) + $sub_element[$field]['#options'];
+          '' => '-' . $label,
+        ) + $sub_element[$field]['#options'];
       }
     }
   }
 
-  // Views exposed filters are treated as submitted even if not,
-  // so force the #default value in that case. Make sure we set
-  // a default that is in the option list.
+  // Views exposed filters are treated as submitted even if not, so force the
+  // #default value in that case. Make sure we set a default that is in the
+  // option list.
   if (!empty($element['#force_value'])) {
     $options = $sub_element[$field]['#options'];
     $default = !empty($sub_element[$field]['#default_value']) ? $sub_element[$field]['#default_value'] : array_shift($options);
@@ -686,9 +695,9 @@ function date_parts_element($element, $date, $format) {
 /**
  * Validation function for date selector.
  *
- * When used as a Views widget, the validation step always gets triggered,
- * even with no form submission. Before form submission $element['#value']
- * contains a string, after submission it contains an array.
+ * When used as a Views widget, the validation step always gets triggered, even
+ * with no form submission. Before form submission $element['#value'] contains a
+ * string, after submission it contains an array.
  */
 function date_select_validate($element, &$form_state) {
   if (date_hidden_element($element)) {
@@ -755,7 +764,6 @@ function date_select_validate($element, &$form_state) {
  * Helper function for creating a date object out of user input.
  */
 function date_select_input_date($element, $input) {
-
   // Was anything entered? If not, we have no date.
   if (!is_array($input)) {
     return NULL;
@@ -790,5 +798,6 @@ function date_select_input_date($element, $input) {
     }
     return $date;
   }
+
   return NULL;
 }
diff --git a/drupal7/sites/all/modules/date/date_api/date_api_ical.inc b/drupal7/sites/all/modules/date/date_api/date_api_ical.inc
index 4911298c..faf3f1a0 100644
--- a/drupal7/sites/all/modules/date/date_api/date_api_ical.inc
+++ b/drupal7/sites/all/modules/date/date_api/date_api_ical.inc
@@ -10,75 +10,75 @@
 /**
  * Return an array of iCalendar information from an iCalendar file.
  *
- *   No timezone adjustment is performed in the import since the timezone
- *   conversion needed will vary depending on whether the value is being
- *   imported into the database (when it needs to be converted to UTC), is being
- *   viewed on a site that has user-configurable timezones (when it needs to be
- *   converted to the user's timezone), if it needs to be converted to the
- *   site timezone, or if it is a date without a timezone which should not have
- *   any timezone conversion applied.
+ * No timezone adjustment is performed in the import since the timezone
+ * conversion needed will vary depending on whether the value is being
+ * imported into the database (when it needs to be converted to UTC), is being
+ * viewed on a site that has user-configurable timezones (when it needs to be
+ * converted to the user's timezone), if it needs to be converted to the site
+ * timezone, or if it is a date without a timezone which should not have any
+ * timezone conversion applied.
  *
- *   Properties that have dates and times are converted to sub-arrays like:
- *      'datetime'   => date in YYYY-MM-DD HH:MM format, not timezone adjusted
- *      'all_day'    => whether this is an all-day event
- *      'tz'         => the timezone of the date, could be blank for absolute
- *                      times that should get no timezone conversion.
+ * Properties that have dates and times are converted to sub-arrays like:
+ * 'datetime' => Date in YYYY-MM-DD HH:MM format, not timezone adjusted.
+ * 'all_day'  => Whether this is an all-day event.
+ * 'tz'       => The timezone of the date, could be blank for absolute times
+ *               that should get no timezone conversion.
  *
- *   Exception dates can have muliple values and are returned as arrays
- *   like the above for each exception date.
+ * Exception dates can have muliple values and are returned as arrayslike the
+ * above for each exception date.
  *
- *   Most other properties are returned as PROPERTY => VALUE.
+ * Most other properties are returned as PROPERTY => VALUE.
  *
- *   Each item in the VCALENDAR will return an array like:
- *   [0] => Array (
- *     [TYPE] => VEVENT
- *     [UID] => 104
- *     [SUMMARY] => An example event
- *     [URL] => http://example.com/node/1
- *     [DTSTART] => Array (
- *       [datetime] => 1997-09-07 09:00:00
+ * Each item in the VCALENDAR will return an array like:
+ * [0] => Array (
+ *   [TYPE] => VEVENT
+ *   [UID] => 104
+ *   [SUMMARY] => An example event
+ *   [URL] => http://example.com/node/1
+ *   [DTSTART] => Array (
+ *     [datetime] => 1997-09-07 09:00:00
+ *     [all_day] => 0
+ *     [tz] => US/Eastern
+ *   )
+ *   [DTEND] => Array (
+ *     [datetime] => 1997-09-07 11:00:00
+ *     [all_day] => 0
+ *     [tz] => US/Eastern
+ *   )
+ *   [RRULE] => Array (
+ *     [FREQ] => Array (
+ *       [0] => MONTHLY
+ *     )
+ *     [BYDAY] => Array (
+ *       [0] => 1SU
+ *       [1] => -1SU
+ *     )
+ *   )
+ *   [EXDATE] => Array (
+ *     [0] = Array (
+ *       [datetime] => 1997-09-21 09:00:00
  *       [all_day] => 0
  *       [tz] => US/Eastern
  *     )
- *     [DTEND] => Array (
- *       [datetime] => 1997-09-07 11:00:00
+ *     [1] = Array (
+ *       [datetime] => 1997-10-05 09:00:00
  *       [all_day] => 0
  *       [tz] => US/Eastern
  *     )
- *     [RRULE] => Array (
- *       [FREQ] => Array (
- *         [0] => MONTHLY
- *       )
- *       [BYDAY] => Array (
- *         [0] => 1SU
- *         [1] => -1SU
- *       )
- *     )
- *     [EXDATE] => Array (
- *       [0] = Array (
- *         [datetime] => 1997-09-21 09:00:00
- *         [all_day] => 0
- *         [tz] => US/Eastern
- *       )
- *       [1] = Array (
- *         [datetime] => 1997-10-05 09:00:00
- *         [all_day] => 0
- *         [tz] => US/Eastern
- *       )
+ *   )
+ *   [RDATE] => Array (
+ *     [0] = Array (
+ *       [datetime] => 1997-09-21 09:00:00
+ *       [all_day] => 0
+ *       [tz] => US/Eastern
  *     )
- *     [RDATE] => Array (
- *       [0] = Array (
- *         [datetime] => 1997-09-21 09:00:00
- *         [all_day] => 0
- *         [tz] => US/Eastern
- *       )
- *       [1] = Array (
- *         [datetime] => 1997-10-05 09:00:00
- *         [all_day] => 0
- *         [tz] => US/Eastern
- *       )
+ *     [1] = Array (
+ *       [datetime] => 1997-10-05 09:00:00
+ *       [all_day] => 0
+ *       [tz] => US/Eastern
  *     )
  *   )
+ * )
  *
  * @todo
  *   figure out how to handle this if subgroups are nested,
@@ -130,7 +130,7 @@ function date_ical_import($filename) {
  * @return array
  *   An array with all the elements from the ical.
  */
-function date_ical_parse($icaldatafolded = array()) {
+function date_ical_parse(array $icaldatafolded = array()) {
   $items = array();
 
   // Verify this is iCal data.
@@ -249,7 +249,6 @@ function date_ical_parse($icaldatafolded = array()) {
 
             array_pop($subgroups);
             array_pop($parents);
-            break;
         }
       }
     }
@@ -325,7 +324,6 @@ function date_ical_parse($icaldatafolded = array()) {
         // be given special treatment.
         default:
           $parse_result = $data;
-          break;
       }
 
       // Store the result of our parsing.
@@ -339,14 +337,14 @@ function date_ical_parse($icaldatafolded = array()) {
  * Parses a ical date element.
  *
  * Possible formats to parse include:
- *   PROPERTY:YYYYMMDD[T][HH][MM][SS][Z]
- *   PROPERTY;VALUE=DATE:YYYYMMDD[T][HH][MM][SS][Z]
- *   PROPERTY;VALUE=DATE-TIME:YYYYMMDD[T][HH][MM][SS][Z]
- *   PROPERTY;TZID=XXXXXXXX;VALUE=DATE:YYYYMMDD[T][HH][MM][SS]
- *   PROPERTY;TZID=XXXXXXXX:YYYYMMDD[T][HH][MM][SS]
+ * - PROPERTY:YYYYMMDD[T][HH][MM][SS][Z]
+ * - PROPERTY;VALUE=DATE:YYYYMMDD[T][HH][MM][SS][Z]
+ * - PROPERTY;VALUE=DATE-TIME:YYYYMMDD[T][HH][MM][SS][Z]
+ * - PROPERTY;TZID=XXXXXXXX;VALUE=DATE:YYYYMMDD[T][HH][MM][SS]
+ * - PROPERTY;TZID=XXXXXXXX:YYYYMMDD[T][HH][MM][SS]
  *
- *   The property and the colon before the date are removed in the import
- *   process above and we are left with $field and $data.
+ * The property and the colon before the date are removed in the import
+ * process above and we are left with $field and $data.
  *
  * @param string $field
  *   The text before the colon and the date, i.e.
@@ -356,22 +354,20 @@ function date_ical_parse($icaldatafolded = array()) {
  *   'Z', if supplied, means the date is in UTC.
  *
  * @return array
- *   $items array, consisting of:
- *      'datetime'   => date in YYYY-MM-DD HH:MM format, not timezone adjusted
- *      'all_day'    => whether this is an all-day event with no time
- *      'tz'         => the timezone of the date, could be blank if the ical
- *                      has no timezone; the ical specs say no timezone
- *                      conversion should be done if no timezone info is
- *                      supplied
- * @todo
- *   Another option for dates is the format PROPERTY;VALUE=PERIOD:XXXX. The
+ *   Consisting of:
+ *   'datetime' => Date in YYYY-MM-DD HH:MM format, not timezone adjusted.
+ *   'all_day'  => Whether this is an all-day event with no time.
+ *   'tz'       => The timezone of the date, could be blank if the iCal has no
+ *                 timezone; the ical specs say no timezone conversion should be
+ *                 done if no timezone info is supplied.
+ *
+ * @todo Another option for dates is the format PROPERTY;VALUE=PERIOD:XXXX. The
  *   period may include a duration, or a date and a duration, or two dates, so
  *   would have to be split into parts and run through date_ical_parse_date()
  *   and date_ical_parse_duration(). This is not commonly used, so ignored for
  *   now. It will take more work to figure how to support that.
  */
 function date_ical_parse_date($field, $data) {
-
   $items = array('datetime' => '', 'all_day' => '', 'tz' => '');
   if (empty($data)) {
     return $items;
@@ -415,6 +411,7 @@ function date_ical_parse_date($field, $data) {
         break;
     }
   }
+
   // If no format is specified, attempt a loose match.
   else {
     preg_match(DATE_REGEX_LOOSE, $data, $regs);
@@ -462,8 +459,9 @@ function date_ical_parse_date($field, $data) {
  * Parse an ical repeat rule.
  *
  * @return array
- *   Array in the form of PROPERTY => array(VALUES)
- *   PROPERTIES include FREQ, INTERVAL, COUNT, BYDAY, BYMONTH, BYYEAR, UNTIL
+ *   A nested array in the form of 'PROPERTY' => array(VALUES) where
+ *   'PROPERTIES' includes 'FREQ', 'INTERVAL', 'COUNT', 'BYDAY', 'BYMONTH',
+ *   'BYYEAR', 'UNTIL'.
  */
 function date_ical_parse_rrule($field, $data) {
   $data = preg_replace("/RRULE.*:/", '', $data);
@@ -496,7 +494,7 @@ function date_ical_parse_rrule($field, $data) {
  * Parse exception dates (can be multiple values).
  *
  * @return array
- *   an array of date value arrays.
+ *   An array of date value arrays.
  */
 function date_ical_parse_exceptions($field, $data) {
   $data = str_replace($field . ':', '', $data);
@@ -512,15 +510,17 @@ function date_ical_parse_exceptions($field, $data) {
  * Parses the duration of the event.
  *
  * Example:
- *  DURATION:PT1H30M
- *  DURATION:P1Y2M
+ * DURATION:PT1H30M
+ * DURATION:P1Y2M.
  *
  * @param array $subgroup
  *   Array of other values in the vevent so we can check for DTSTART.
+ * @param string $value_name
+ *   The name of the value to process; defaults to 'DURATION'.
  */
-function date_ical_parse_duration(&$subgroup, $field = 'DURATION') {
-  $items = $subgroup[$field];
-  $data  = $items['DATA'];
+function date_ical_parse_duration(array &$subgroup, $value_name = 'DURATION') {
+  $items = $subgroup[$value_name];
+  $data = $items['DATA'];
   preg_match('/^P(\d{1,4}[Y])?(\d{1,2}[M])?(\d{1,2}[W])?(\d{1,2}[D])?([T]{0,1})?(\d{1,2}[H])?(\d{1,2}[M])?(\d{1,2}[S])?/', $data, $duration);
   $items['year'] = isset($duration[1]) ? str_replace('Y', '', $duration[1]) : '';
   $items['month'] = isset($duration[2]) ? str_replace('M', '', $duration[2]) : '';
@@ -535,7 +535,7 @@ function date_ical_parse_duration(&$subgroup, $field = 'DURATION') {
     $timezone = 'UTC';
   }
   $date = new DateObject($start_date, $timezone);
-  $date2 = clone($date);
+  $date2 = clone $date;
   foreach ($items as $item => $count) {
     if ($count > 0) {
       date_modify($date2, '+' . $count . ' ' . $item);
@@ -573,8 +573,8 @@ function date_ical_parse_text($field, $data) {
  * Catch situations like the upcoming.org feed that uses
  * LOCATION;VENUE-UID="http://upcoming.yahoo.com/venue/104/":111 First Street...
  * or more normal LOCATION;UID=123:111 First Street...
- * Upcoming feed would have been improperly broken on the ':' in http://
- * so we paste the $field and $data back together first.
+ * Upcoming feed would have been improperly broken on the ':' in http:// so we
+ * paste the $field and $data back together first.
  *
  * Use non-greedy check for ':' in case there are more of them in the address.
  */
@@ -603,8 +603,7 @@ function date_ical_parse_location($field, $data) {
  * @return object
  *   A timezone-adjusted date object.
  */
-function date_ical_date($ical_date, $to_tz = FALSE) {
-
+function date_ical_date(array $ical_date, $to_tz = FALSE) {
   // If the ical date has no timezone, must assume it is stateless
   // so treat it as a local date.
   if (empty($ical_date['datetime'])) {
@@ -621,7 +620,7 @@ function date_ical_date($ical_date, $to_tz = FALSE) {
   }
   $date = new DateObject($ical_date['datetime'], new DateTimeZone($from_tz));
 
-  if ($to_tz && $ical_date['tz'] != '' && $to_tz != $ical_date['tz']) {
+  if ($to_tz && !empty($ical_date['tz']) && $to_tz != $ical_date['tz']) {
     date_timezone_set($date, timezone_open($to_tz));
   }
   return $date;
@@ -631,7 +630,7 @@ function date_ical_date($ical_date, $to_tz = FALSE) {
  * Escape #text elements for safe iCal use.
  *
  * @param string $text
- *   Text to escape
+ *   Text to escape.
  *
  * @return string
  *   Escaped text
@@ -639,9 +638,9 @@ function date_ical_date($ical_date, $to_tz = FALSE) {
 function date_ical_escape_text($text) {
   $text = drupal_html_to_text($text);
   $text = trim($text);
-  // TODO Per #38130 the iCal specs don't want : and " escaped
-  // but there was some reason for adding this in. Need to watch
-  // this and see if anything breaks.
+  // @todo Per #38130 the iCal specs don't want : and " escaped but there was
+  // some reason for adding this in. Need to watch this and see if anything
+  // breaks.
   // $text = str_replace('"', '\"', $text);
   // $text = str_replace(":", "\:", $text);
   $text = preg_replace("/\\\b/", "\\\\", $text);
@@ -695,7 +694,7 @@ function date_ical_escape_text($text) {
  *       )
  *     )
  */
-function date_api_ical_build_rrule($form_values) {
+function date_api_ical_build_rrule(array $form_values) {
   $rrule = '';
   if (empty($form_values) || !is_array($form_values)) {
     return $rrule;
@@ -725,9 +724,9 @@ function date_api_ical_build_rrule($form_values) {
   if (array_key_exists('BYMONTHDAY', $form_values) && is_array($form_values['BYMONTHDAY']) && $bymonthday = implode(",", $form_values['BYMONTHDAY'])) {
     $rrule .= ';BYMONTHDAY=' . $bymonthday;
   }
-  // The UNTIL date is supposed to always be expressed in UTC.
-  // The input date values may already have been converted to a date object on a
-  // previous pass, so check for that.
+  // The UNTIL date is supposed to always be expressed in UTC. The input date
+  // values may already have been converted to a date object on a previous
+  // pass, so check for that.
   if (array_key_exists('UNTIL', $form_values) && array_key_exists('datetime', $form_values['UNTIL']) && !empty($form_values['UNTIL']['datetime'])) {
     // We only collect a date for UNTIL, but we need it to be inclusive, so
     // force it to a full datetime element at the last second of the day.
@@ -754,8 +753,8 @@ function date_api_ical_build_rrule($form_values) {
     }
     $rrule .= ';UNTIL=' . date_format($until, DATE_FORMAT_ICAL) . 'Z';
   }
-  // Our form doesn't allow a value for COUNT, but it may be needed by
-  // modules using the API, so add it to the rule.
+  // Our form doesn't allow a value for COUNT, but it may be needed by modules
+  // using the API, so add it to the rule.
   if (array_key_exists('COUNT', $form_values)) {
     $rrule .= ';COUNT=' . $form_values['COUNT'];
   }
@@ -769,9 +768,9 @@ function date_api_ical_build_rrule($form_values) {
     $rrule .= ';WKST=' . date_repeat_dow2day(variable_get('date_first_day', 0));
   }
 
-  // Exceptions dates go last, on their own line.
-  // The input date values may already have been converted to a date
-  // object on a previous pass, so check for that.
+  // Exceptions dates go last, on their own line. The input date values may
+  // already have been converted to a date object on a previous pass, so check
+  // for that.
   if (isset($form_values['EXDATE']) && is_array($form_values['EXDATE'])) {
     $ex_dates = array();
     foreach ($form_values['EXDATE'] as $value) {
diff --git a/drupal7/sites/all/modules/date/date_api/date_api_sql.inc b/drupal7/sites/all/modules/date/date_api/date_api_sql.inc
index a95ca4ef..093562e6 100644
--- a/drupal7/sites/all/modules/date/date_api/date_api_sql.inc
+++ b/drupal7/sites/all/modules/date/date_api/date_api_sql.inc
@@ -4,7 +4,7 @@
  * @file
  * SQL helper for Date API.
  *
- * @TODO
+ * @todo
  * Add experimental support for sqlite: http://www.sqlite.org/lang_datefunc.html
  * and Oracle (http://psoug.org/reference/date_func.html and
  * http://psoug.org/reference/datatypes.html) date/time functions.
@@ -19,7 +19,7 @@
  * @return string
  *   Correct sql string for database type.
  */
-function date_sql_concat($array) {
+function date_sql_concat(array $array) {
   switch (Database::getConnection()->databaseType()) {
     case 'mysql':
       return "CONCAT(" . implode(",", $array) . ")";
@@ -38,7 +38,7 @@ function date_sql_concat($array) {
  * @return string
  *   SQL statement to return the first non-NULL value in the list.
  */
-function date_sql_coalesce($array) {
+function date_sql_coalesce(array $array) {
   switch (Database::getConnection()->databaseType()) {
     case 'mysql':
     case 'pgsql':
@@ -50,13 +50,13 @@ function date_sql_coalesce($array) {
  * A helper function to do cross-database padding of date parts.
  *
  * @param string $str
- *   A string to apply padding to
+ *   A string to apply padding to.
  * @param int $size
- *   The size the final string should be
+ *   The size the final string should be.
  * @param string $pad
- *   The value to pad the string with
+ *   The value to pad the string with.
  * @param string $side
- *   The side of the string to pad
+ *   The side of the string to pad.
  */
 function date_sql_pad($str, $size = 2, $pad = '0', $side = 'l') {
   switch ($side) {
@@ -71,7 +71,6 @@ function date_sql_pad($str, $size = 2, $pad = '0', $side = 'l') {
 /**
  * A class to manipulate date SQL.
  */
-// @codingStandardsIgnoreStart
 class date_sql_handler {
   var $db_type = NULL;
   var $date_type = DATE_DATETIME;
@@ -113,9 +112,17 @@ class date_sql_handler {
           break;
 
         case 'pgsql':
-          $test = db_query("SELECT '2008-02-15 12:00:00 UTC' AT TIME ZONE 'US/Central'")->fetchField();
-          if ($test == '2008-02-15 06:00:00') {
-            $has_support = TRUE;
+          // PostgreSQL doesn't always have timezone support enabled, so catch
+          // exceptions so they don't break the site. This is safe to do as it
+          // is only checking to see if timezones are actually supported.
+          try {
+            $test = db_query("SELECT '2008-02-15 12:00:00 UTC' AT TIME ZONE 'US/Central'")->fetchField();
+            if ($test == '2008-02-15 06:00:00') {
+              $has_support = TRUE;
+            }
+          }
+          catch (PDOException $e) {
+            // No support.
           }
           break;
       }
@@ -218,7 +225,7 @@ class date_sql_handler {
       case 'pgsql':
         switch ($this->date_type) {
           case DATE_UNIX:
-            $field = "$field::ABSTIME";
+            $field = "TO_TIMESTAMP($field)";
             break;
 
           case DATE_ISO:
@@ -294,8 +301,8 @@ class date_sql_handler {
    * @param int $count
    *   The number of values to adjust.
    * @param string $granularity
-   *   The granularity of the adjustment, should be singular,
-   *   like SECOND, MINUTE, DAY, HOUR.
+   *   The granularity of the adjustment, should be singular, like SECOND,
+   *   MINUTE, DAY, HOUR.
    */
   function sql_date_math($field, $direction, $count, $granularity) {
     $granularity = strtoupper($granularity);
@@ -303,10 +310,10 @@ class date_sql_handler {
       case 'mysql':
         switch ($direction) {
           case 'ADD':
-            return "DATE_ADD($field, INTERVAL $count $granularity)";
+            return "DATE_ADD(CAST($field AS DATETIME), INTERVAL $count $granularity)";
 
           case 'SUB':
-            return "DATE_SUB($field, INTERVAL $count $granularity)";
+            return "DATE_SUB(CAST($field AS DATETIME), INTERVAL $count $granularity)";
         }
 
       case 'pgsql':
@@ -332,23 +339,20 @@ class date_sql_handler {
   }
 
   /**
-   * Select a date value from the database, adjusting the value
-   * for the timezone.
+   * Select a date value from the database, adjusting for the timezone.
    *
-   * Check whether database timezone conversion is supported in
-   * this system and use it if possible, otherwise use an
-   * offset.
+   * Check whether database timezone conversion is supported in this system and
+   * use it if possible, otherwise use an offset.
    *
    * @param string $field
    *   The field to be adjusted.
    * @param bool $offset
-   *   Set a fixed offset or offset field to use for the date.
-   *   If set, no timezone conversion will be done and the
-   *   offset will be used.
+   *   Set a fixed offset or offset field to use for the date. If set, no
+   *   timezone conversion will be done and the offset will be used.
    */
   function sql_tz($field, $offset = NULL, $comp_date = NULL) {
-    // If the timezones are values they need to be quoted, but
-    // if they are field names they do not.
+    // If the timezones are values they need to be quoted, but if they are
+    // field names they do not.
     $db_zone   = !empty($this->db_timezone_field) ? $this->db_timezone_field : "'{$this->db_timezone}'";
     $localzone = !empty($this->local_timezone_field) ? $this->local_timezone_field : "'{$this->local_timezone}'";
     // If a fixed offset is required, use it.
@@ -359,8 +363,8 @@ class date_sql_handler {
     elseif ($db_zone == $localzone) {
       return $this->sql_offset($field, 0);
     }
-    // If the db has no timezone support, adjust by the offset,
-    // could be either a field name or a value.
+    // If the db has no timezone support, adjust by the offset, could be either
+    // a field name or a value.
     elseif (!$this->db_tz_support() || empty($localzone)) {
       if (!empty($this->offset_field)) {
         return $this->sql_offset($field, $this->offset_field);
@@ -441,7 +445,7 @@ class date_sql_handler {
           's' => 'SS',
           'A' => 'AM',
           '\T' => '"T"',
-          // '\W' => // TODO, what should this be?
+          // '\W' => // @todo what should this be?
         );
         $format = strtr($format, $replace);
         return "TO_CHAR($field, '$format')";
@@ -584,6 +588,7 @@ class date_sql_handler {
           case 'pgsql':
             return "EXTRACT(WEEK FROM($field))";
         }
+
       case 'DOW':
         switch ($this->db_type) {
           case 'mysql':
@@ -594,6 +599,7 @@ class date_sql_handler {
           case 'pgsql':
             return "EXTRACT(DOW FROM($field))";
         }
+  
       case 'DOY':
         switch ($this->db_type) {
           case 'mysql':
@@ -636,8 +642,8 @@ class date_sql_handler {
         date_modify($date, $adjustment . ' seconds');
       }
       // When comparing a field to a date we can avoid doing timezone
-      // conversion by altering the comparison date to the db timezone.
-      // This won't work if the timezone is a field instead of a value.
+      // conversion by altering the comparison date to the db timezone. This
+      // won't work if the timezone is a field instead of a value.
       if (empty($this->db_timezone_field) && empty($this->local_timezone_field) && $this->db_timezone_field != $this->local_timezone_field) {
         $date->setTimezone(timezone_open($this->db_timezone));
         $this->local_timezone = $this->db_timezone;
@@ -706,7 +712,9 @@ class date_sql_handler {
 
   /**
    * An array of all date parts,
-   * optionally limited to an array of allowed parts.
+   *
+   * @param bool $limit
+   *   Limit to an array of allowed parts.
    */
   function date_parts($limit = NULL) {
     $parts = array(
@@ -738,8 +746,8 @@ class date_sql_handler {
    *   'min', 'max', 'format', 'sep', 'empty_now', 'empty_min', 'empty_max' .
    *   Returns all info if empty.
    * @param string $part
-   *   'year', 'month', 'day', 'hour', 'minute', or 'second.
-   *   returns info for all parts if empty.
+   *   'year', 'month', 'day', 'hour', 'minute', or 'second. Returns info for
+   *   all parts if empty.
    */
   function part_info($op = NULL, $part = NULL) {
     $info = array();
@@ -813,10 +821,10 @@ class date_sql_handler {
   /**
    * Create a complete date/time value out of an incomplete array of values.
    *
-   * For example, array('year' => 2008, 'month' => 05) will fill
-   * in the day, hour, minute and second with the earliest possible
-   * values if type = 'min', the latest possible values if type = 'max',
-   * and the current values if type = 'now' .
+   * For example, array('year' => 2008, 'month' => 05) will fill in the day,
+   * hour, minute and second with the earliest possible values if type = 'min',
+   * the latest possible values if type = 'max', and the current values if type
+   * = 'now'.
    */
   function complete_date($selected, $type = 'now') {
     if (empty($selected)) {
@@ -1119,8 +1127,8 @@ class date_sql_handler {
   /**
    * Granularity arguments handler.
    *
-   * Use the parsed values from the ISO argument
-   * to determine the granularity of this period.
+   * Use the parsed values from the ISO argument to determine the granularity
+   * of this period.
    */
   function arg_granularity($arg) {
     $granularity = '';
@@ -1133,8 +1141,9 @@ class date_sql_handler {
   }
 
   /**
-   * Use the parsed values from the ISO argument to determine the
-   * min and max date for this period.
+   * Determine the min and max date for this period.
+   *
+   * Uses the parsed values from the ISO argument.
    */
   function arg_range($arg) {
     // Parse the argument to get its parts.
@@ -1143,7 +1152,7 @@ class date_sql_handler {
     // Build a range from a period-only argument (assumes the min date is now.)
     if (empty($parts[0]['date']) && !empty($parts[0]['period']) && (empty($parts[1]))) {
       $min_date = date_now();
-      $max_date = clone($min_date);
+      $max_date = clone $min_date;
       foreach ($parts[0]['period'] as $part => $value) {
         date_modify($max_date, "+$value $part");
       }
@@ -1153,7 +1162,7 @@ class date_sql_handler {
     // Build a range from a period to period argument.
     if (empty($parts[0]['date']) && !empty($parts[0]['period']) && !empty($parts[1]['period'])) {
       $min_date = date_now();
-      $max_date = clone($min_date);
+      $max_date = clone $min_date;
       foreach ($parts[0]['period'] as $part => $value) {
         date_modify($min_date, "+$value $part");
       }
@@ -1176,7 +1185,7 @@ class date_sql_handler {
       // Build a range from start date + period.
       elseif (!empty($parts[1]['period'])) {
         foreach ($parts[1]['period'] as $part => $value) {
-          $max_date = clone($min_date);
+          $max_date = clone $min_date;
           date_modify($max_date, "+$value $part");
         }
         date_modify($max_date, '-1 second');
@@ -1204,4 +1213,3 @@ class date_sql_handler {
     return array($now, $now);
   }
 }
-// @codingStandardsIgnoreEnd
diff --git a/drupal7/sites/all/modules/date/date_api/date_year_range.js b/drupal7/sites/all/modules/date/date_api/date_year_range.js
index f301b991..0ce04b19 100644
--- a/drupal7/sites/all/modules/date/date_api/date_year_range.js
+++ b/drupal7/sites/all/modules/date/date_api/date_year_range.js
@@ -1,223 +1,228 @@
+/**
+ * @file
+ */
 (function ($) {
 
-Drupal.behaviors.dateYearRange = {};
-
-Drupal.behaviors.dateYearRange.attach = function (context, settings) {
-  var $textfield, $textfields, i;
+  Drupal.behaviors.dateYearRange = {};
 
-  // Turn the years back and forward fieldsets into dropdowns.
-  $textfields = $('input.select-list-with-custom-option', context).once('date-year-range');
-  for (i = 0; i < $textfields.length; i++) {
-    $textfield = $($textfields[i]);
-    new Drupal.dateYearRange.SelectListWithCustomOption($textfield);
-  }
-};
+  Drupal.behaviors.dateYearRange.attach = function (context, settings) {
+    var $textfield, $textfields, i;
 
+    // Turn the years back and forward fieldsets into dropdowns.
+    $textfields = $('input.select-list-with-custom-option', context).once('date-year-range');
+    for (i = 0; i < $textfields.length; i++) {
+      $textfield = $($textfields[i]);
+      new Drupal.dateYearRange.SelectListWithCustomOption($textfield);
+    }
+  };
 
-Drupal.dateYearRange = {};
+  Drupal.dateYearRange = {};
 
-/**
+  /**
  * Constructor for the SelectListWithCustomOption object.
  *
  * This object is responsible for turning the years back and forward textfields
  * into dropdowns with an 'other' option that lets the user enter a custom
  * value.
  */
-Drupal.dateYearRange.SelectListWithCustomOption = function ($textfield) {
-  this.$textfield = $textfield;
-  this.$description = $textfield.next('div.description');
-  this.defaultValue = $textfield.val();
-  this.$dropdown = this.createDropdown();
-  this.$dropdown.insertBefore($textfield);
-};
-
-/**
- * Get the value of the textfield as it existed on page load.
- *
- * @param {String} type
- *   The type of the variable to be returned. Defaults to string.
- * @return
- *   The original value of the textfield. Returned as an integer, if the type
- *   parameter was 'int'.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.getOriginal = function (type) {
-  var original;
-  if (type === 'int') {
-    original = parseInt(this.defaultValue, 10);
-    if (window.isNaN(original)) {
-      original = 0;
+  Drupal.dateYearRange.SelectListWithCustomOption = function ($textfield) {
+    this.$textfield = $textfield;
+    this.$description = $textfield.next('div.description');
+    this.defaultValue = $textfield.val();
+    this.$dropdown = this.createDropdown();
+    this.$dropdown.insertBefore($textfield);
+  };
+
+  /**
+   * Get the value of the textfield as it existed on page load.
+   *
+   * @param {String} type
+   *   The type of the variable to be returned. Defaults to string.
+   *
+   * @return
+   *   The original value of the textfield. Returned as an integer, if the type
+   *   parameter was 'int'.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.getOriginal = function (type) {
+    var original;
+    if (type === 'int') {
+      original = parseInt(this.defaultValue, 10);
+      if (window.isNaN(original)) {
+        original = 0;
+      }
     }
-  }
-  else {
-    original = this.defaultValue;
-  }
-  return original;
-};
-
-/**
- * Get the correct first value for the dropdown.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.getStartValue = function () {
-  var direction = this.getDirection();
-  var start;
-  switch (direction) {
-    case 'back':
-      // For the 'years back' dropdown, the first option should be -10, unless
-      // the default value of the textfield is even smaller than that.
-      start = Math.min(this.getOriginal('int'), -10);
-      break;
-    case 'forward':
-      start = 0;
+    else {
+      original = this.defaultValue;
+    }
+    return original;
+  };
+
+  /**
+   * Get the correct first value for the dropdown.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.getStartValue = function () {
+    var direction = this.getDirection();
+    var start;
+    switch (direction) {
+      case 'back':
+        // For the 'years back' dropdown, the first option should be -10, unless
+        // the default value of the textfield is even smaller than that.
+        start = Math.min(this.getOriginal('int'), -10);
       break;
-  }
-  return start;
-};
 
-/**
- * Get the correct last value for the dropdown.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.getEndValue = function () {
-  var direction = this.getDirection();
-  var end;
-  var originalString = this.getOriginal();
-  switch (direction) {
-    case 'back':
-      end = 0;
+      case 'forward':
+        start = 0;
       break;
-    case 'forward':
-      // If the original value of the textfield is an absolute year such as
-      // 2020, don't try to include it in the dropdown.
-      if (originalString.indexOf('+') === -1) {
-        end = 10;
-      }
-      // If the original value is a relative value (+x), we want it to be
-      // included in the possible dropdown values.
-      else {
-        end = Math.max(this.getOriginal('int'), 10);
-      }
+    }
+    return start;
+  };
+
+  /**
+   * Get the correct last value for the dropdown.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.getEndValue = function () {
+    var direction = this.getDirection();
+    var end;
+    var originalString = this.getOriginal();
+    switch (direction) {
+      case 'back':
+        end = 0;
       break;
-  }
-  return end;
-};
 
-/**
- * Create a dropdown select list with the correct options for this textfield.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.createDropdown = function () {
-  var $dropdown = $('<select>').addClass('form-select date-year-range-select');
-  var $option, i, value;
-  var start = this.getStartValue();
-  var end = this.getEndValue();
-  var direction = this.getDirection();
-  for (i = start; i <= end; i++) {
-    // Make sure we include the +/- sign in the option value.
-    value = i;
-    if (i > 0) {
-      value = '+' + i;
+      case 'forward':
+        // If the original value of the textfield is an absolute year such as
+        // 2020, don't try to include it in the dropdown.
+        if (originalString.indexOf('+') === -1) {
+          end = 10;
+        }
+        // If the original value is a relative value (+x), we want it to be
+        // included in the possible dropdown values.
+        else {
+          end = Math.max(this.getOriginal('int'), 10);
+        }
+      break;
     }
-    // Zero values must have a + or - in front.
-    if (i === 0) {
-      if (direction === 'back') {
-        value = '-' + i;
-      }
-      else {
+    return end;
+  };
+
+  /**
+   * Create a dropdown select list with the correct options for this textfield.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.createDropdown = function () {
+    var $dropdown = $('<select>').addClass('form-select date-year-range-select');
+    var $option, i, value;
+    var start = this.getStartValue();
+    var end = this.getEndValue();
+    var direction = this.getDirection();
+    for (i = start; i <= end; i++) {
+      // Make sure we include the +/- sign in the option value.
+      value = i;
+      if (i > 0) {
         value = '+' + i;
       }
+      // Zero values must have a + or - in front.
+      if (i === 0) {
+        if (direction === 'back') {
+          value = '-' + i;
+        }
+        else {
+          value = '+' + i;
+        }
+      }
+      $option = $('<option>' + Drupal.formatPlural(value, '@count year from now', '@count years from now') + '</option>').val(value);
+      $dropdown.append($option);
     }
-    $option = $('<option>' + Drupal.formatPlural(value, '@count year from now', '@count years from now') + '</option>').val(value);
+    // Create an 'Other' option.
+    $option = $('<option class="custom-option">' + Drupal.t('Other') + '</option>').val('');
     $dropdown.append($option);
-  }
-  // Create an 'Other' option.
-  $option = $('<option class="custom-option">' + Drupal.t('Other') + '</option>').val('');
-  $dropdown.append($option);
-
-  // When the user changes the selected option in the dropdown, perform
-  // appropriate actions (such as showing or hiding the textfield).
-  $dropdown.bind('change', $.proxy(this.handleDropdownChange, this));
-
-  // Set the initial value of the dropdown.
-  this._setInitialDropdownValue($dropdown);
-  return $dropdown;
-};
-
-Drupal.dateYearRange.SelectListWithCustomOption.prototype._setInitialDropdownValue = function ($dropdown) {
-  var textfieldValue = this.getOriginal();
-  // Determine whether the original textfield value exists in the dropdown.
-  var possible = $dropdown.find('option[value="' + textfieldValue + '"]');
-  // If the original textfield value is one of the dropdown options, preselect
-  // it and hide the 'other' textfield.
-  if (possible.length) {
-    $dropdown.val(textfieldValue);
-    this.hideTextfield();
-  }
-  // If the original textfield value isn't one of the dropdown options, choose
-  // the 'Other' option in the dropdown.
-  else {
-    $dropdown.val('');
-  }
-};
-
-/**
- * Determine whether this is the "years back" or "years forward" textfield.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.getDirection = function () {
-  if (this.direction) {
-    return this.direction;
-  }
-  var direction;
-  if (this.$textfield.hasClass('back')) {
-    direction = 'back';
-  }
-  else if (this.$textfield.hasClass('forward')) {
-    direction = 'forward';
-  }
-  this.direction = direction;
-  return direction;
-};
-
-/**
- * Change handler for the dropdown, to modify the textfield as appropriate.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.handleDropdownChange = function () {
-  // Since the dropdown changed, we need to make the content of the textfield
-  // match the (new) selected option.
-  this.syncTextfield();
-
-  // Show the textfield if the 'Other' option was selected, and hide it if one
-  // of the preset options was selected.
-  if ($(':selected', this.$dropdown).hasClass('custom-option')) {
-    this.revealTextfield();
-  }
-  else {
-    this.hideTextfield();
-  }
-};
-
-/**
- * Display the textfield and its description.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.revealTextfield = function () {
-  this.$textfield.show();
-  this.$description.show();
-};
 
-/**
- * Hide the textfield and its description.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.hideTextfield = function () {
-  this.$textfield.hide();
-  this.$description.hide();
-};
-
-/**
- * Copy the selected value of the dropdown to the textfield.
- *
- * FAPI doesn't know about the JS-only dropdown, so the textfield needs to
- * reflect the value of the dropdown.
- */
-Drupal.dateYearRange.SelectListWithCustomOption.prototype.syncTextfield = function () {
-  var value = this.$dropdown.val();
-  this.$textfield.val(value);
-};
+    // When the user changes the selected option in the dropdown, perform
+    // appropriate actions (such as showing or hiding the textfield).
+    $dropdown.bind('change', $.proxy(this.handleDropdownChange, this));
+
+    // Set the initial value of the dropdown.
+    this._setInitialDropdownValue($dropdown);
+    return $dropdown;
+  };
+
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype._setInitialDropdownValue = function ($dropdown) {
+    var textfieldValue = this.getOriginal();
+    // Determine whether the original textfield value exists in the dropdown.
+    var possible = $dropdown.find('option[value="' + textfieldValue + '"]');
+    // If the original textfield value is one of the dropdown options, preselect
+    // it and hide the 'other' textfield.
+    if (possible.length) {
+      $dropdown.val(textfieldValue);
+      this.hideTextfield();
+    }
+    // If the original textfield value isn't one of the dropdown options, choose
+    // the 'Other' option in the dropdown.
+    else {
+      $dropdown.val('');
+    }
+  };
+
+  /**
+   * Determine whether this is the "years back" or "years forward" textfield.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.getDirection = function () {
+    if (this.direction) {
+      return this.direction;
+    }
+    var direction;
+    if (this.$textfield.hasClass('back')) {
+      direction = 'back';
+    }
+    else if (this.$textfield.hasClass('forward')) {
+      direction = 'forward';
+    }
+    this.direction = direction;
+    return direction;
+  };
+
+  /**
+   * Change handler for the dropdown, to modify the textfield as appropriate.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.handleDropdownChange = function () {
+    // Since the dropdown changed, we need to make the content of the textfield
+    // match the (new) selected option.
+    this.syncTextfield();
+
+    // Show the textfield if the 'Other' option was selected, and hide it if one
+    // of the preset options was selected.
+    if ($(':selected', this.$dropdown).hasClass('custom-option')) {
+      this.revealTextfield();
+    }
+    else {
+      this.hideTextfield();
+    }
+  };
+
+  /**
+   * Display the textfield and its description.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.revealTextfield = function () {
+    this.$textfield.show();
+    this.$description.show();
+  };
+
+  /**
+   * Hide the textfield and its description.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.hideTextfield = function () {
+    this.$textfield.hide();
+    this.$description.hide();
+  };
+
+  /**
+   * Copy the selected value of the dropdown to the textfield.
+   *
+   * FAPI doesn't know about the JS-only dropdown, so the textfield needs to
+   * reflect the value of the dropdown.
+   */
+  Drupal.dateYearRange.SelectListWithCustomOption.prototype.syncTextfield = function () {
+    var value = this.$dropdown.val();
+    this.$textfield.val(value);
+  };
 
 })(jQuery);
diff --git a/drupal7/sites/all/modules/date/tests/date_api.test b/drupal7/sites/all/modules/date/date_api/tests/DateApiTestCase.test
similarity index 97%
rename from drupal7/sites/all/modules/date/tests/date_api.test
rename to drupal7/sites/all/modules/date/date_api/tests/DateApiTestCase.test
index 03c9081b..a9200bff 100644
--- a/drupal7/sites/all/modules/date/tests/date_api.test
+++ b/drupal7/sites/all/modules/date/date_api/tests/DateApiTestCase.test
@@ -2,10 +2,14 @@
 
 /**
  * @file
- * Test Date API functions
+ * Test Date API functions.
  */
 
-class DateAPITestCase extends DrupalWebTestCase {
+/**
+ * Test Date API functions.
+ */
+class DateApiTestCase extends DrupalWebTestCase {
+
   /**
    * @todo.
    */
@@ -18,11 +22,12 @@ class DateAPITestCase extends DrupalWebTestCase {
   }
 
   /**
-   * @todo.
+   * {@inheritdoc}
    */
-  public function setUp() {
-    // Load the date_api module.
-    parent::setUp('date_api');
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_api';
+    parent::setUp($modules);
+
     variable_set('date_api_use_iso8601', FALSE);
     variable_set('date_first_day', 1);
   }
@@ -270,7 +275,7 @@ class DateAPITestCase extends DrupalWebTestCase {
     $value = $date->getOffset();
     $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
 
-     // Create date object from datetime string and convert it to a local date.
+    // Create date object from datetime string and convert it to a local date.
     $input = '1970-01-01 00:00:00';
     $timezone = 'UTC';
     $date = new dateObject($input, $timezone);
@@ -327,7 +332,7 @@ class DateAPITestCase extends DrupalWebTestCase {
     $value = $date->getOffset();
     $this->assertEqual($expected, $value, "The current offset should be $expected, found $value.");
 
-     // Create year-only date.
+    // Create year-only date.
     $input = '2009';
     $timezone = NULL;
     $format = 'Y';
@@ -336,7 +341,7 @@ class DateAPITestCase extends DrupalWebTestCase {
     $expected = '2009';
     $this->assertEqual($expected, $value, "Test new dateObject($input, $timezone, $format): should be $expected, found $value.");
 
-     // Create month and year-only date.
+    // Create month and year-only date.
     $input = '2009-10';
     $timezone = NULL;
     $format = 'Y-m';
@@ -345,7 +350,7 @@ class DateAPITestCase extends DrupalWebTestCase {
     $expected = '2009-10';
     $this->assertEqual($expected, $value, "Test new dateObject($input, $timezone, $format): should be $expected, found $value.");
 
-     // Create time-only date.
+    // Create time-only date.
     $input = '0000-00-00T10:30:00';
     $timezone = NULL;
     $format = 'Y-m-d\TH:i:s';
@@ -354,7 +359,7 @@ class DateAPITestCase extends DrupalWebTestCase {
     $expected = '10:30:00';
     $this->assertEqual($expected, $value, "Test new dateObject($input, $timezone, $format): should be $expected, found $value.");
 
-     // Create time-only date.
+    // Create time-only date.
     $input = '10:30:00';
     $timezone = NULL;
     $format = 'H:i:s';
@@ -389,7 +394,8 @@ class DateAPITestCase extends DrupalWebTestCase {
       $this->assertFalse(date_range_valid($range), "$range recognized as an invalid date range.");
     }
 
-    // Test for invalid month names when we are using a short version of the month
+    // Test for invalid month names when we are using a short version of the
+    // month.
     $input = '23 abc 2012';
     $timezone = NULL;
     $format = 'd M Y';
@@ -428,4 +434,5 @@ class DateAPITestCase extends DrupalWebTestCase {
     variable_del('date_api_use_iso8601');
     parent::tearDown();
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/date_api/tests/DateApiUnitTestCase.test b/drupal7/sites/all/modules/date/date_api/tests/DateApiUnitTestCase.test
new file mode 100644
index 00000000..bd594872
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_api/tests/DateApiUnitTestCase.test
@@ -0,0 +1,267 @@
+<?php
+
+/**
+ * @file
+ * Unit tests for Date API functions.
+ */
+
+/**
+ * Unit tests for Date API functions.
+ */
+class DateApiUnitTestCase extends DrupalUnitTestCase {
+
+  /**
+   * @todo.
+   */
+  public static function getInfo() {
+    return array(
+      'name' => t('Date API unit tests'),
+      'description' => t('Unit test coverage for Date API functions.') ,
+      'group' => t('Date'),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    drupal_load('module', 'date_api');
+    parent::setUp();
+  }
+
+  /**
+   * Tests for date_is_all_day().
+   */
+  public function testDateIsAllDay() {
+    // Two empty strings, this should always return FALSE.
+    $string1 = '';
+    $string2 = '';
+    $response = date_is_all_day($string1, $string2);
+    $this->assertFalse($response, 'Two empty strings cannot represent an all-day date pair.');
+
+    // Two random date strings do not make an all-day pair.
+    $string1 = '2021-02-25 01:01:01';
+    $string2 = '2021-02-25 23:00:00';
+    $response = date_is_all_day($string1, $string2);
+    $this->assertFalse($response, 'Two random date strings do not make an "all day" pair.');
+
+    // It is not a valid "all day" date pair to start one second after midnight
+    // and end on midnight the next day.
+    $string1 = '2021-02-25 00:00:01';
+    $string2 = '2021-02-26 00:00:00';
+    $response = date_is_all_day($string1, $string2);
+    $this->assertFalse($response, 'Does not mark dates as "all day" if the first is 1 second after midnight on day 1 and the other is midnight on day 2.');
+
+    // A valid "all day" date pair when the granularity is 1, regardless of the
+    // unit.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:59:59';
+
+    // The granularity option must be one of a limited set of strings.
+    $response = date_is_all_day($string1, $string2, 'mango');
+    $this->assertFalse($response, 'The granularity argument must be one of a limited set of strings, so "mango" will not work.');
+
+    // A valid "all day" date pair starts at midnight and ends one second before
+    // midnight, both on the same day.
+    $response = date_is_all_day($string1, $string2);
+    $this->assertTrue($response, 'An "all day" date pair must start at midnight and end one time unit before midnight of the next day.');
+
+    // Confirm the granularity option works with seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to "second".');
+
+    // Confirm the granularity option works with minutes.
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to "minute".');
+
+    // Confirm the granularity option works with hours.
+    $response = date_is_all_day($string1, $string2, 'hour');
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to "hour".');
+
+    // Test the "increment" argument with a unit of 1.
+    $response = date_is_all_day($string1, $string2, 'second', 1);
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to 1 "second".');
+    $response = date_is_all_day($string1, $string2, 'minute', 1);
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to 1 "minute".');
+    $response = date_is_all_day($string1, $string2, 'hour', 1);
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to 1 "hour".');
+
+    // Test the "increment" argument with a unit of 15.
+    $response = date_is_all_day($string1, $string2, 'second', 15);
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to 15 "second".');
+    $response = date_is_all_day($string1, $string2, 'minute', 15);
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to 15 "minute".');
+    $response = date_is_all_day($string1, $string2, 'hour', 15);
+    $this->assertTrue($response, 'End time is 23:59:59 and granularity is set to 15 "hour".');
+
+    // A datetime pair ending at 23:59:00.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:59:00';
+
+    // This pair will only be valid when the granularity is "minute" or "hour".
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, 'Not valid with an end time of 23:59:00 and granularity is set to "second".');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertTrue($response, '23:59:00 is a valid end time if the granularity is set to "minute".');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertTrue($response, '23:59:00 is a valid end time if the granularity is set to "hour".');
+
+    // A datetime pair ending at 23:59:24. This is to confirm that segments of
+    // the time, after the granularity option, are ignored.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:59:24';
+
+    // This pair will only be valid when the granularity is "minute" or "hour".
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, 'Not valid with an end time of 23:59:24 and granularity is set to "second".');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertTrue($response, '23:59:24 is a valid end time if the granularity is set to "minute".');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertTrue($response, '23:59:24 is a valid end time if the granularity is set to "hour".');
+
+    // A datetime pair ending at 23:00:00.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:00:00';
+
+    // This pair will only be valid when the granularity is "minute" or "hour".
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, 'Not valid with an end time of 23:00:00 and granularity is set to "second".');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertFalse($response, 'Not valid with an end time of 23:00:00 and granularity is set to "minute".');
+    $response = date_is_all_day($string1, $string2, 'hour');
+    $this->assertTrue($response, '23:00:00 is a valid end time if the granularity is set to "hour".');
+
+    // A datetime pair ending at 23:13:00.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:13:00';
+
+    // This pair will only be valid when the granularity is "minute" or "hour".
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, 'Not valid with an end time of 23:13:00 and granularity is set to "second".');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertFalse($response, 'Not valid with an end time of 23:13:00 and granularity is set to "minute".');
+    $response = date_is_all_day($string1, $string2, 'hour');
+    $this->assertTrue($response, '23:00:00 is a valid end time if the granularity is set to "hour".');
+
+    // A datetime pair ending at 23:59:55.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:59:55';
+
+    // Test the "increment" argument with 5 seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, '23:59:55 is not a valid end time when the increment is set to 1 second.');
+    $response = date_is_all_day($string1, $string2, 'second', 5);
+    $this->assertTrue($response, '23:59:55 is a valid end time when the increment is set to 5 seconds.');
+    $response = date_is_all_day($string1, $string2, 'minute', 5);
+    $this->assertTrue($response, '23:59:55 is a valid end time when the increment is set to 5 minutes.');
+    $response = date_is_all_day($string1, $string2, 'hour', 5);
+    $this->assertTrue($response, '23:59:55 is a valid end time when the increment is set to 5 hours.');
+
+    // A datetime pair ending at 23:55:00.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:55:00';
+
+    // Test the "increment" argument with 5 seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, '23:55:00 is not a valid end time when the increment is set to 1 second.');
+    $response = date_is_all_day($string1, $string2, 'second', 5);
+    $this->assertFalse($response, '23:55:00 is not a valid end time when the increment is set to 5 seconds.');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertFalse($response, '23:55:00 is not a valid end time when the increment is set to 1 minute.');
+    $response = date_is_all_day($string1, $string2, 'minute', 5);
+    $this->assertTrue($response, '23:55:00 is a valid end time when the increment is set to 5 minutes.');
+    $response = date_is_all_day($string1, $string2, 'hour', 5);
+    $this->assertTrue($response, '23:55:00 is a valid end time when the increment is set to 5 hours.');
+
+    // A datetime pair ending at 23:59:50.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:59:50';
+
+    // Test the "increment" argument with 5 seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, '23:59:50 is not a valid end time when the increment is set to 1 second.');
+    $response = date_is_all_day($string1, $string2, 'second', 10);
+    $this->assertTrue($response, '23:59:50 is a valid end time when the increment is set to 10 seconds.');
+    $response = date_is_all_day($string1, $string2, 'minute', 10);
+    $this->assertTrue($response, '23:59:50 is a valid end time when the increment is set to 10 minutes.');
+    $response = date_is_all_day($string1, $string2, 'hour', 10);
+    $this->assertTrue($response, '23:59:50 is a valid end time when the increment is set to 10 hours.');
+
+    // A datetime pair ending at 23:50:00.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:50:00';
+
+    // Test the "increment" argument with 5 seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, '23:50:00 is not a valid end time when the increment is set to 1 second.');
+    $response = date_is_all_day($string1, $string2, 'second', 10);
+    $this->assertFalse($response, '23:50:00 is not a valid end time when the increment is set to 10 seconds.');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertFalse($response, '23:50:00 is not a valid end time when the increment is set to 1 minute.');
+    $response = date_is_all_day($string1, $string2, 'minute', 10);
+    $this->assertTrue($response, '23:50:00 is a valid end time when the increment is set to 10 minutes.');
+    $response = date_is_all_day($string1, $string2, 'hour', 10);
+    $this->assertTrue($response, '23:50:00 is a valid end time when the increment is set to 10 hours.');
+
+    // A datetime pair ending at 23:59:45.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:59:45';
+
+    // Test the "increment" argument with 5 seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, '23:59:45 is not a valid end time when the increment is set to 1 second.');
+    $response = date_is_all_day($string1, $string2, 'second', 15);
+    $this->assertTrue($response, '23:59:45 is a valid end time when the increment is set to 15 seconds.');
+    $response = date_is_all_day($string1, $string2, 'minute', 15);
+    $this->assertTrue($response, '23:59:45 is a valid end time when the increment is set to 15 minutes.');
+    $response = date_is_all_day($string1, $string2, 'hour', 15);
+    $this->assertTrue($response, '23:59:45 is a valid end time when the increment is set to 15 hours.');
+
+    // A datetime pair ending at 23:45:00.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:45:00';
+
+    // Test the "increment" argument with 5 seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, '23:45:00 is not a valid end time when the increment is set to 1 second.');
+    $response = date_is_all_day($string1, $string2, 'second', 15);
+    $this->assertFalse($response, '23:45:00 is not a valid end time when the increment is set to 15 seconds.');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertFalse($response, '23:45:00 is not a valid end time when the increment is set to 1 minute.');
+    $response = date_is_all_day($string1, $string2, 'minute', 15);
+    $this->assertTrue($response, '23:45:00 is a valid end time when the increment is set to 15 minutes.');
+    $response = date_is_all_day($string1, $string2, 'hour', 15);
+    $this->assertTrue($response, '23:45:00 is a valid end time when the increment is set to 15 hours.');
+
+    // A datetime pair ending at 23:59:30.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:59:30';
+
+    // Test the "increment" argument with 5 seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, '23:59:30 is not a valid end time when the increment is set to 1 second.');
+    $response = date_is_all_day($string1, $string2, 'second', 30);
+    $this->assertTrue($response, '23:59:30 is a valid end time when the increment is set to 30 seconds.');
+    $response = date_is_all_day($string1, $string2, 'minute', 30);
+    $this->assertTrue($response, '23:59:30 is a valid end time when the increment is set to 30 minutes.');
+    $response = date_is_all_day($string1, $string2, 'hour', 30);
+    $this->assertTrue($response, '23:59:30 is a valid end time when the increment is set to 30 hours.');
+
+    // A datetime pair ending at 23:30:00.
+    $string1 = '2021-02-25 00:00:00';
+    $string2 = '2021-02-25 23:30:00';
+
+    // Test the "increment" argument with 5 seconds.
+    $response = date_is_all_day($string1, $string2, 'second');
+    $this->assertFalse($response, '23:30:00 is not a valid end time when the increment is set to 1 second.');
+    $response = date_is_all_day($string1, $string2, 'second', 30);
+    $this->assertFalse($response, '23:30:00 is not a valid end time when the increment is set to 30 seconds.');
+    $response = date_is_all_day($string1, $string2, 'minute');
+    $this->assertFalse($response, '23:30:00 is not a valid end time when the increment is set to 1 minute.');
+    $response = date_is_all_day($string1, $string2, 'minute', 30);
+    $this->assertTrue($response, '23:30:00 is a valid end time when the increment is set to 30 minutes.');
+    $response = date_is_all_day($string1, $string2, 'hour', 30);
+    $this->assertTrue($response, '23:30:00 is a valid end time when the increment is set to 30 hours.');
+  }
+
+}
diff --git a/drupal7/sites/all/modules/date/date_api/theme/theme.inc b/drupal7/sites/all/modules/date/date_api/theme/theme.inc
index 0a57ecd0..b216614e 100644
--- a/drupal7/sites/all/modules/date/date_api/theme/theme.inc
+++ b/drupal7/sites/all/modules/date/date_api/theme/theme.inc
@@ -168,7 +168,6 @@ function theme_date_part_label_time($variables) {
   return t('Time', array(), array('context' => 'datetime'));
 }
 
-
 /**
  * Returns HTML for a date block that looks like a mini calendar day.
  *
@@ -194,7 +193,7 @@ function theme_date_calendar_day($variables) {
 function theme_date_time_ago($variables) {
   $start_date = $variables['start_date'];
   $end_date = $variables['end_date'];
-  $use_end_date = isset($variables['use_end_date']) ? $variables['use_end_date'] : false;
+  $use_end_date = isset($variables['use_end_date']) ? $variables['use_end_date'] : FALSE;
   $interval = !empty($variables['interval']) ? $variables['interval'] : 2;
   $display = isset($variables['interval_display']) ? $variables['interval_display'] : 'time ago';
 
@@ -204,7 +203,7 @@ function theme_date_time_ago($variables) {
   }
 
   // We use the end date only when the option is checked.
-  if ($use_end_date){
+  if ($use_end_date) {
     $date = date_format($end_date, DATE_FORMAT_UNIX);
   }
   else {
@@ -212,10 +211,10 @@ function theme_date_time_ago($variables) {
   }
 
   // Time to compare dates to.
-
   $now = date_format(date_now(), DATE_FORMAT_UNIX);
 
-  // Will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence).
+  // Will be positive for a datetime in the past (ago), and negative for a
+  // datetime in the future (hence).
   $time_diff = $now - $date;
 
   // Uses the same options used by Views format_interval.
@@ -240,6 +239,5 @@ function theme_date_time_ago($variables) {
 
     case 'time span':
       return t(($time_diff < 0 ? '%time hence' : '%time ago'), array('%time' => format_interval(abs($time_diff), $interval)));
-
   }
 }
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 97cb8c9d..09b154f2 100644
--- a/drupal7/sites/all/modules/date/date_context/date_context.info
+++ b/drupal7/sites/all/modules/date/date_context/date_context.info
@@ -3,14 +3,13 @@ description = Adds an option to the Context module to set a context condition ba
 package = Date/Time
 core = 7.x
 
-dependencies[] = date
-dependencies[] = context
+dependencies[] = date:date
+dependencies[] = context:context
 
-files[] = date_context.module
 files[] = plugins/date_context_date_condition.inc
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date_context/date_context.module b/drupal7/sites/all/modules/date/date_context/date_context.module
index 9b568e15..01ba4a97 100644
--- a/drupal7/sites/all/modules/date/date_context/date_context.module
+++ b/drupal7/sites/all/modules/date/date_context/date_context.module
@@ -1,14 +1,13 @@
 <?php
+
 /**
  * @file
  * Add an option to set/not set the context on forms vs views.
  *
- * @TODO
- *
- * Currently only implemented for nodes. Need to add $plugin->execute()
+ * @todo Currently only implemented for nodes. Need to add $plugin->execute()
  * for any other entities that might be supported.
  *
- * Cache the date processing, perhaps cache the formatted, timezone-adjusted
+ * @todo Cache the date processing, perhaps cache the formatted, tz-adjusted
  * date strings for each entity (would have to be cached differently for each
  * timezone, based on the tz_handling method for the date).
  */
diff --git a/drupal7/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc b/drupal7/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc
index 97c18b47..9e03dff8 100644
--- a/drupal7/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc
+++ b/drupal7/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc
@@ -2,13 +2,12 @@
 
 /**
  * @file
- * Context date condition plugin.
+ * Context condition plugin for date values.
  */
 
 /**
- * Expose term views/term forms by vocabulary as a context condition.
+ * Context condition plugin for date values.
  */
-// @codingStandardsIgnoreStart
 class date_context_date_condition extends context_condition_node {
 
   /**
@@ -71,7 +70,6 @@ class date_context_date_condition extends context_condition_node {
         $fields = $this->fetch_from_context($context, 'values');
 
         foreach ($fields as $field_name => $label) {
-
           // If this field does not exist on this entity, just move along.
           if (empty($entity->{$field_name})) {
             continue;
@@ -79,19 +77,22 @@ class date_context_date_condition extends context_condition_node {
 
           $items = field_get_items('node', $entity, $field_name);
 
-          // If there are no values, nothing to do unless we were looking for 'empty' or '!='.
+          // If there are no values, nothing to do unless we were looking for
+          // 'empty' or '!='.
           if (empty($items)) {
             if ($options['operation'] == '!=' || $options['operation'] == 'empty') {
               $this->condition_met($context, $field_name);
             }
           }
 
-          // We don't have to construct the date values if we're just testing for 'not empty'.
+          // We don't have to construct the date values if we're just testing
+          // for 'not empty'.
           elseif ($options['operation'] == 'not empty') {
             $this->condition_met($context, $field_name);
           }
 
-          // All other operations need to retrieve the date values for comparision.
+          // All other operations need to retrieve the date values for
+          // comparision.
           else {
             $field = field_info_field($field_name);
             $timezone_db = date_get_timezone_db($field['settings']['tz_handling']);
@@ -152,5 +153,5 @@ class date_context_date_condition extends context_condition_node {
       }
     }
   }
+
 }
-// @codingStandardsIgnoreEnd
diff --git a/drupal7/sites/all/modules/date/date_elements.inc b/drupal7/sites/all/modules/date/date_elements.inc
index 656d4998..88490c22 100644
--- a/drupal7/sites/all/modules/date/date_elements.inc
+++ b/drupal7/sites/all/modules/date/date_elements.inc
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Date forms and form themes and validation.
@@ -42,38 +43,46 @@
  *   the local timezone, are converted back to their UTC values and stored.
  */
 function date_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $base) {
-
   $element = $base;
   $field_name = $field['field_name'];
   $entity_type = $instance['entity_type'];
 
   // If this is a new entity, populate the field with the right default values.
-  // This happens early so even fields later hidden with #access get those values.
-  // We should only add default values to new entities, to avoid over-writing
-  // a value that has already been set. This means we can't just check to see
-  // if $items is empty, because it might have been set that way on purpose.
-  // @see date_field_widget_properties_alter() where we flagged if this is a new entity.
-
-  // We check !isset($items[$delta]['value']) because entity translation may create
-  // a new translation entity for an existing entity and we don't want to clobber
-  // values that were already set in that case.
+  // This happens early so even fields later hidden with #access get those
+  // values. We should only add default values to new entities, to avoid
+  // over-writing a value that has already been set. This means we can't just
+  // check to see if $items is empty, because it might have been set that way
+  // on purpose. In date_field_widget_properties_alter() this is flagged if
+  // this is a new entity. Check !isset($items[$delta]['value']) because entity
+  // translation may create a new translation entity for an existing entity and
+  // we don't want to clobber values that were already set in that case.
+  // @see date_field_widget_properties_alter()
   // @see http://drupal.org/node/1478848.
-
   $is_default = FALSE;
-  if (!empty($instance['widget']['is_new']) && !isset($items[$delta]['value'])) {
-    $items = date_default_value($field, $instance, $langcode);
-    $is_default = TRUE;
+  if (!isset($items[$delta]['value'])) {
+    if (!empty($instance['widget']['is_new'])) {
+      // New entity; use default values defined on instance.
+      $items = date_default_value($field, $instance, $langcode);
+      $is_default = TRUE;
+    }
+    else {
+      // Date is empty; create array structure for value keys.
+      $keys = date_process_values($field);
+      $items[$delta] = array_fill_keys($keys, '');
+    }
   }
 
-  // @TODO Repeating dates should probably be made into their own field type and completely separated out.
-  // That will have to wait for a new branch since it may break other things, including other modules
-  // that have an expectation of what the date field types are.
-
-  // Since repeating dates cannot use the default Add more button, we have to handle our own behaviors here.
-  // Return only the first multiple value for repeating dates, then clean up the 'Add more' bits in #after_build.
-  // The repeating values will be re-generated when the repeat widget form is validated.
-  // At this point we can't tell if this form element is going to be hidden by #access, and we're going to
-  // lose all but the first value by doing this, so store the original values in case we need to replace them later.
+  // @todo Repeating dates should probably be made into their own field type
+  // and completely separated out. That will have to wait for a new branch
+  // since it may break other things, including other modules that have an
+  // expectation of what the date field types are. Since repeating dates cannot
+  // use the default Add more button, we have to handle our own behaviors here.
+  // Return only the first multiple value for repeating dates, then clean up
+  // the 'Add more' bits in #after_build. The repeating values will be
+  // re-generated when the repeat widget form is validated. At this point we
+  // can't tell if this form element is going to be hidden by #access, and
+  // we're going to lose all but the first value by doing this, so store the
+  // original values in case we need to replace them later.
   if (!empty($field['settings']['repeat']) && module_exists('date_repeat_field')) {
     if ($delta == 0) {
       $form['#after_build'][] = 'date_repeat_after_build';
@@ -101,13 +110,13 @@ function date_field_widget_form(&$form, &$form_state, $field, $instance, $langco
     '#type' => 'date_combo',
     '#theme_wrappers' => array('date_combo'),
     '#weight' => $delta,
-    '#default_value' => isset($items[$delta]) ? $items[$delta] : '',
+    '#default_value' => isset($items[$delta]) ? $items[$delta] : array(),
     '#date_timezone' => $timezone,
     '#element_validate' => array('date_combo_validate'),
     '#date_is_default' => $is_default,
 
     // Store the original values, for use with disabled and hidden fields.
-    '#date_items' => isset($items[$delta]) ? $items[$delta] : '',
+    '#date_items' => isset($items[$delta]) ? $items[$delta] : array(),
   );
 
   $element['#title'] = $instance['label'];
@@ -126,8 +135,8 @@ function date_field_widget_form(&$form, &$form_state, $field, $instance, $langco
 
   // Make changes if instance is set to be rendered as a regular field.
   if (!empty($instance['widget']['settings']['no_fieldset'])) {
-   $element['#title'] = check_plain($instance['label']);
-   $element['#theme_wrappers'] = ($field['cardinality'] == 1) ? array('date_form_element') : array();
+    $element['#title'] = check_plain($instance['label']);
+    $element['#theme_wrappers'] = ($field['cardinality'] == 1) ? array('date_form_element') : array();
   }
 
   return $element;
@@ -136,12 +145,11 @@ function date_field_widget_form(&$form, &$form_state, $field, $instance, $langco
 /**
  * Create local date object.
  *
- * Create a date object set to local time from the field and
- * widget settings and item values. Default values for new entities
- * are set by the default value callback, so don't need to be accounted for here.
+ * Create a date object set to local time from the field and widget settings and
+ * item values. Default values for new entities are set by the default value
+ * callback, so don't need to be accounted for here.
  */
 function date_local_date($item, $timezone, $field, $instance, $part = 'value') {
-
   $value = $item[$part];
 
   // If the value is empty, don't try to create a date object because it will
@@ -150,7 +158,7 @@ function date_local_date($item, $timezone, $field, $instance, $part = 'value') {
     return NULL;
   }
 
-  // @TODO Figure out how to replace date_fuzzy_datetime() function.
+  // @todo Figure out how to replace date_fuzzy_datetime() function.
   // Special case for ISO dates to create a valid date object for formatting.
   // Is this still needed?
   // @codingStandardsIgnoreStart
@@ -200,7 +208,7 @@ function date_default_value($field, $instance, $langcode) {
 }
 
 /**
- * Helper function for the date default value callback to set either 'value' or 'value2' to its default value.
+ * Default value callback to set either 'value', 'value2' to its default value.
  */
 function date_default_value_part($item, $field, $instance, $langcode, $part = 'value') {
   $timezone = date_get_timezone($field['settings']['tz_handling']);
@@ -225,12 +233,13 @@ function date_default_value_part($item, $field, $instance, $langcode, $part = 'v
       return NULL;
     }
     else {
-      // The date stored in 'value' has already been switched to the db timezone.
+      // The date stored in 'value' has already been switched to the db
+      // timezone.
       $date = new DateObject($item[0]['value'], $timezone_db, DATE_FORMAT_DATETIME);
     }
   }
-  // Special case for 'now' when using dates with no timezone,
-  // make sure 'now' isn't adjusted to UTC value of 'now' .
+  // Special case for 'now' when using dates with no timezone, make sure 'now'
+  // isn't adjusted to UTC value of 'now'.
   elseif ($field['settings']['tz_handling'] == 'none') {
     $date = date_now();
   }
@@ -266,7 +275,8 @@ function date_combo_element_process($element, &$form_state, $form) {
   $field = field_widget_field($element, $form_state);
   $instance = field_widget_instance($element, $form_state);
 
-  // Figure out how many items are in the form, including new ones added by ajax.
+  // Figure out how many items are in the form, including new ones added by
+  // ajax.
   $field_state = field_form_get_state($element['#field_parents'], $field_name, $element['#language'], $form_state);
   $items_count = $field_state['items_count'];
 
@@ -280,18 +290,19 @@ function date_combo_element_process($element, &$form_state, $form) {
   $offset_field = 'offset';
   $offset_field2 = 'offset2';
 
-  // Convert UTC dates to their local values in DATETIME format,
-  // and adjust the default values as specified in the field settings.
-
-  // It would seem to make sense to do this conversion when the data
-  // is loaded instead of when the form is created, but the loaded
-  // field data is cached and we can't cache dates that have been converted
-  // to the timezone of an individual user, so we cache the UTC values
-  // instead and do our conversion to local dates in the form and
-  // in the formatters.
+  // Convert UTC dates to their local values in DATETIME format, and adjust the
+  // default values as specified in the field settings. It would seem to make
+  // sense to do this conversion when the data is loaded instead of when the
+  // form is created, but the loaded field data is cached and we can't cache
+  // dates that have been converted to the timezone of an individual user, so
+  // we cache the UTC values instead and do our conversion to local dates in
+  // the form and in the formatters.
   $process = date_process_values($field, $instance);
   foreach ($process as $processed) {
     if (!isset($element['#default_value'][$processed])) {
+      if (empty($element['#default_value']) || !is_array($element['#default_value'])) {
+        $element['#default_value'] = array();
+      }
       $element['#default_value'][$processed] = '';
     }
     $date = date_local_date($element['#default_value'], $element['#date_timezone'], $field, $instance, $processed);
@@ -299,11 +310,12 @@ function date_combo_element_process($element, &$form_state, $form) {
   }
 
   // Blank out the end date for optional end dates that match the start date,
-  // except when this is a new node that has default values that should be honored.
+  // except when this is a new node that has default values that should be
+  // honored.
   if (!$date_is_default && $field['settings']['todate'] != 'required'
-  && is_array($element['#default_value'])
-  && !empty($element['#default_value'][$to_field])
-  && $element['#default_value'][$to_field] == $element['#default_value'][$from_field]) {
+      && is_array($element['#default_value'])
+      && !empty($element['#default_value'][$to_field])
+      && $element['#default_value'][$to_field] == $element['#default_value'][$from_field]) {
     unset($element['#default_value'][$to_field]);
   }
 
@@ -343,8 +355,8 @@ function date_combo_element_process($element, &$form_state, $form) {
     $element['#description'] = $element['value']['#instance']['description'];
   }
 
-  // Give this element the right type, using a Date API
-  // or a Date Popup element type.
+  // Give this element the right type, using a Date API or a Date Popup element
+  // type.
   $element[$from_field]['#attributes'] = array('class' => array('date-clear'));
   $element[$from_field]['#wrapper_attributes'] = array('class' => array());
   $element[$from_field]['#wrapper_attributes']['class'][] = 'date-no-float';
@@ -360,6 +372,9 @@ function date_combo_element_process($element, &$form_state, $form) {
     case 'date_popup':
       $element[$from_field]['#type'] = 'date_popup';
       $element[$from_field]['#theme_wrappers'] = array('date_popup');
+      // Disable autocomplete in browsers.
+      // @see https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
+      $element[$from_field]['#attributes']['autocomplete'] = 'off';
       $element[$from_field]['#ajax'] = !empty($element['#ajax']) ? $element['#ajax'] : FALSE;
       break;
 
@@ -367,13 +382,10 @@ function date_combo_element_process($element, &$form_state, $form) {
       $element[$from_field]['#type'] = 'date_text';
       $element[$from_field]['#theme_wrappers'] = array('date_text');
       $element[$from_field]['#ajax'] = !empty($element['#ajax']) ? $element['#ajax'] : FALSE;
-      break;
   }
 
-  // If this field uses the 'End', add matching element
-  // for the 'End' date, and adapt titles to make it clear which
-  // is the 'Start' and which is the 'End' .
-
+  // If this field uses the 'End', add matching element for the 'End' date, and
+  // adapt titles to make it clear which is the 'Start' and which is the 'End' .
   if (!empty($field['settings']['todate'])) {
     $element[$to_field] = $element[$from_field];
     $element[$from_field]['#title_display'] = 'none';
@@ -423,9 +435,9 @@ function date_combo_element_process($element, &$form_state, $form) {
   }
 
   $context = array(
-    'field'     => $field,
-    'instance'  => $instance,
-    'form'      => $form,
+    'field' => $field,
+    'instance' => $instance,
+    'form' => $form,
   );
   drupal_alter('date_combo_process', $element, $form_state, $context);
 
@@ -438,8 +450,8 @@ function date_combo_element_process($element, &$form_state, $form) {
 function date_element_empty($element, &$form_state) {
   $item = array();
   $item['value'] = NULL;
-  $item['value2']   = NULL;
-  $item['timezone']   = NULL;
+  $item['value2'] = NULL;
+  $item['timezone'] = NULL;
   $item['offset'] = NULL;
   $item['offset2'] = NULL;
   $item['rrule'] = NULL;
@@ -453,10 +465,9 @@ function date_element_empty($element, &$form_state) {
  * Don't try this if there were errors before reaching this point.
  */
 function date_combo_validate($element, &$form_state) {
-
-  // Disabled and hidden elements won't have any input and don't need validation,
-  // we just need to re-save the original values, from before they were processed into
-  // widget arrays and timezone-adjusted.
+  // Disabled and hidden elements won't have any input and don't need
+  // validation, we just need to re-save the original values, from before they
+  // were processed into widget arrays and timezone-adjusted.
   if (date_hidden_element($element) || !empty($element['#disabled'])) {
     form_set_value($element, $element['#date_items'], $form_state);
     return;
@@ -504,8 +515,8 @@ function date_combo_validate($element, &$form_state) {
   $offset_field = 'offset';
   $offset_field2 = 'offset2';
 
-  // Check for empty 'Start date', which could either be an empty
-  // value or an array of empty values, depending on the widget.
+  // Check for empty 'Start date', which could either be an empty value or an
+  // array of empty values, depending on the widget.
   $empty = TRUE;
   if (!empty($item[$from_field])) {
     if (!is_array($item[$from_field])) {
@@ -567,7 +578,6 @@ function date_combo_validate($element, &$form_state) {
 
     // Neither the start date nor the end date should be empty at this point
     // unless they held values that couldn't be evaluated.
-
     if (!$instance['required'] && (!date_is_date($from_date) || !date_is_date($to_date))) {
       $item = date_element_empty($element, $form_state);
       $errors[] = t('The dates are invalid.');
@@ -577,8 +587,8 @@ function date_combo_validate($element, &$form_state) {
       $errors[] = t('The End date must be greater than the Start date.');
     }
     else {
-      // Convert input dates back to their UTC values and re-format to ISO
-      // or UNIX instead of the DATETIME format used in element processing.
+      // Convert input dates back to their UTC values and re-format to ISO or
+      // UNIX instead of the DATETIME format used in element processing.
       $item[$tz_field] = $timezone;
 
       // Update the context for changes in the $item, and allow other modules to
@@ -587,7 +597,11 @@ function date_combo_validate($element, &$form_state) {
       // We can only pass two additional values to drupal_alter, so $element
       // needs to be included in $context.
       $context['element'] = $element;
+
+      // Trigger hook_date_combo_validate_date_start_alter().
       drupal_alter('date_combo_validate_date_start', $from_date, $form_state, $context);
+
+      // Trigger hook_date_combo_validate_date_end_alter().
       drupal_alter('date_combo_validate_date_end', $to_date, $form_state, $context);
 
       $item[$offset_field] = date_offset_get($from_date);
@@ -604,11 +618,10 @@ function date_combo_validate($element, &$form_state) {
         $item['rrule'] = $form_values[$field['field_name']]['rrule'];
       }
 
-      // If the db timezone is not the same as the display timezone
-      // and we are using a date with time granularity,
-      // test a roundtrip back to the original timezone to catch
-      // invalid dates, like 2AM on the day that spring daylight savings
-      // time begins in the US.
+      // If the db timezone is not the same as the display timezone and we are
+      // using a date with time granularity, test a roundtrip back to the
+      // original timezone to catch invalid dates, like 2AM on the day that
+      // spring daylight savings time begins in the US.
       $granularity = date_format_order($element[$from_field]['#date_format']);
       if ($timezone != $timezone_db && date_has_time($granularity)) {
         date_timezone_set($from_date, timezone_open($timezone));
@@ -626,9 +639,9 @@ function date_combo_validate($element, &$form_state) {
       }
     }
   }
-  // Don't show further errors if errors are already flagged
-  // because otherwise we'll show errors on the nested elements
-  // more than once.
+
+  // Don't show further errors if errors are already flagged because otherwise
+  // we'll show errors on the nested elements more than once.
   if (!form_get_errors() && !empty($errors)) {
     if ($field['cardinality']) {
       form_error($element, t('There are errors in @field_name value #@delta:', array('@field_name' => $instance['label'], '@delta' => $delta + 1)) . theme('item_list', array('items' => $errors)));
@@ -652,7 +665,6 @@ function date_input_format($element, $field, $instance) {
   return variable_get('date_format_short', 'm/d/Y - H:i');
 }
 
-
 /**
  * Implements hook_date_select_pre_validate_alter().
  */
@@ -678,8 +690,9 @@ function date_date_popup_pre_validate_alter(&$element, &$form_state, &$input) {
  * Helper function to clear out end date when not being used.
  */
 function date_empty_end_date(&$element, &$form_state, &$input) {
-  // If this is the end date and the option to show an end date has not been selected,
-  // empty the end date to surpress validation errors and stop further processing.
+  // If this is the end date and the option to show an end date has not been
+  // selected, empty the end date to surpress validation errors and stop
+  // further processing.
   $parents = $element['#parents'];
   $parent = array_pop($parents);
   if ($parent == 'value2') {
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 41e416a3..e67b173c 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,8 @@ core = 7.x
 package = Date/Time
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.features.field.inc b/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.features.field.inc
deleted file mode 100644
index 4d979812..00000000
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.features.field.inc
+++ /dev/null
@@ -1,680 +0,0 @@
-<?php
-
-/**
- * @file
- * Examples and test folder for migration into date fields.
- */
-
-/**
- * Implements hook_field_default_fields().
- */
-function date_migrate_example_field_default_fields() {
-  $fields = array();
-
-  // Exported field: 'node-date_migrate_example-body'
-  $fields['node-date_migrate_example-body'] = array(
-    'field_config' => array(
-      'active' => '1',
-      'cardinality' => '1',
-      'deleted' => '0',
-      'entity_types' => array(
-        '0' => 'node',
-      ),
-      'field_name' => 'body',
-      'foreign keys' => array(
-        'format' => array(
-          'columns' => array(
-            'format' => 'format',
-          ),
-          'table' => 'filter_format',
-        ),
-      ),
-      'indexes' => array(
-        'format' => array(
-          '0' => 'format',
-        ),
-      ),
-      'module' => 'text',
-      'settings' => array(),
-      'translatable' => '1',
-      'type' => 'text_with_summary',
-    ),
-    'field_instance' => array(
-      'bundle' => 'date_migrate_example',
-      'default_value' => NULL,
-      'deleted' => '0',
-      'description' => '',
-      'display' => array(
-        'default' => array(
-          'label' => 'hidden',
-          'module' => 'text',
-          'settings' => array(),
-          'type' => 'text_default',
-          'weight' => '0',
-        ),
-        'teaser' => array(
-          'label' => 'hidden',
-          'module' => 'text',
-          'settings' => array(
-            'trim_length' => 600,
-          ),
-          'type' => 'text_summary_or_trimmed',
-          'weight' => 0,
-        ),
-      ),
-      'entity_type' => 'node',
-      'field_name' => 'body',
-      'label' => 'Body',
-      'required' => FALSE,
-      'settings' => array(
-        'display_summary' => TRUE,
-        'text_processing' => 1,
-        'user_register_form' => FALSE,
-      ),
-      'widget' => array(
-        'module' => 'text',
-        'settings' => array(
-          'rows' => 20,
-          'summary_rows' => 5,
-        ),
-        'type' => 'text_textarea_with_summary',
-        'weight' => '1',
-      ),
-    ),
-  );
-
-  // Exported field: 'node-date_migrate_example-field_date'
-  $fields['node-date_migrate_example-field_date'] = array(
-    'field_config' => array(
-      'active' => '1',
-      'cardinality' => '-1',
-      'deleted' => '0',
-      'entity_types' => array(),
-      'field_name' => 'field_date',
-      'foreign keys' => array(),
-      'indexes' => array(),
-      'module' => 'date',
-      'settings' => array(
-        'granularity' => array(
-          'day' => 'day',
-          'hour' => 'hour',
-          'minute' => 'minute',
-          'month' => 'month',
-          'year' => 'year',
-        ),
-        'repeat' => 0,
-        'timezone_db' => 'UTC',
-        'todate' => '',
-        'tz_handling' => 'site',
-      ),
-      'translatable' => '1',
-      'type' => 'date',
-    ),
-    'field_instance' => array(
-      'bundle' => 'date_migrate_example',
-      'deleted' => '0',
-      'description' => '',
-      'display' => array(
-        'default' => array(
-          'label' => 'above',
-          'module' => 'date',
-          'settings' => array(
-            'format_type' => 'medium',
-            'fromto' => 'both',
-            'multiple_from' => '',
-            'multiple_number' => '',
-            'multiple_to' => '',
-            'show_repeat_rule' => 'show',
-          ),
-          'type' => 'date_default',
-          'weight' => '1',
-        ),
-        'teaser' => array(
-          'label' => 'above',
-          'settings' => array(),
-          'type' => 'hidden',
-          'weight' => 0,
-        ),
-      ),
-      'entity_type' => 'node',
-      'field_name' => 'field_date',
-      'label' => 'Date',
-      'required' => 0,
-      'settings' => array(
-        'default_format' => 'medium',
-        'default_value' => 'now',
-        'default_value2' => 'blank',
-        'default_value_code' => '',
-        'default_value_code2' => '',
-        'user_register_form' => FALSE,
-      ),
-      'widget' => array(
-        'active' => 1,
-        'module' => 'date',
-        'settings' => array(
-          'increment' => 1,
-          'input_format' => 'm/d/Y - H:i:s',
-          'input_format_custom' => '',
-          'label_position' => 'above',
-          'repeat_collapsed' => 0,
-          'text_parts' => array(),
-          'year_range' => '-3:+3',
-        ),
-        'type' => 'date_text',
-        'weight' => '2',
-      ),
-    ),
-  );
-
-  // Exported field: 'node-date_migrate_example-field_date_range'
-  $fields['node-date_migrate_example-field_date_range'] = array(
-    'field_config' => array(
-      'active' => '1',
-      'cardinality' => '-1',
-      'deleted' => '0',
-      'entity_types' => array(),
-      'field_name' => 'field_date_range',
-      'foreign keys' => array(),
-      'indexes' => array(),
-      'module' => 'date',
-      'settings' => array(
-        'granularity' => array(
-          'day' => 'day',
-          'hour' => 'hour',
-          'minute' => 'minute',
-          'month' => 'month',
-          'year' => 'year',
-        ),
-        'repeat' => 0,
-        'timezone_db' => 'UTC',
-        'todate' => 'required',
-        'tz_handling' => 'site',
-      ),
-      'translatable' => '1',
-      'type' => 'date',
-    ),
-    'field_instance' => array(
-      'bundle' => 'date_migrate_example',
-      'deleted' => '0',
-      'description' => '',
-      'display' => array(
-        'default' => array(
-          'label' => 'above',
-          'module' => 'date',
-          'settings' => array(
-            'format_type' => 'medium',
-            'fromto' => 'both',
-            'multiple_from' => '',
-            'multiple_number' => '',
-            'multiple_to' => '',
-            'show_repeat_rule' => 'show',
-          ),
-          'type' => 'date_default',
-          'weight' => '2',
-        ),
-        'teaser' => array(
-          'label' => 'above',
-          'settings' => array(),
-          'type' => 'hidden',
-          'weight' => 0,
-        ),
-      ),
-      'entity_type' => 'node',
-      'field_name' => 'field_date_range',
-      'label' => 'Date range',
-      'required' => 0,
-      'settings' => array(
-        'default_format' => 'medium',
-        'default_value' => 'now',
-        'default_value2' => 'strtotime',
-        'default_value_code' => '',
-        'default_value_code2' => '+7 days',
-        'user_register_form' => FALSE,
-      ),
-      'widget' => array(
-        'active' => 1,
-        'module' => 'date',
-        'settings' => array(
-          'increment' => 1,
-          'input_format' => 'm/d/Y - H:i:s',
-          'input_format_custom' => '',
-          'label_position' => 'above',
-          'repeat_collapsed' => 0,
-          'text_parts' => array(),
-          'year_range' => '-3:+3',
-        ),
-        'type' => 'date_text',
-        'weight' => '3',
-      ),
-    ),
-  );
-
-  // Exported field: 'node-date_migrate_example-field_date_repeat'
-  $fields['node-date_migrate_example-field_date_repeat'] = array(
-    'field_config' => array(
-      'active' => '1',
-      'cardinality' => '-1',
-      'deleted' => '0',
-      'entity_types' => array(),
-      'field_name' => 'field_date_repeat',
-      'foreign keys' => array(),
-      'indexes' => array(),
-      'module' => 'date',
-      'settings' => array(
-        'granularity' => array(
-          'day' => 'day',
-          'hour' => 'hour',
-          'minute' => 'minute',
-          'month' => 'month',
-          'year' => 'year',
-        ),
-        'repeat' => 1,
-        'timezone_db' => 'UTC',
-        'todate' => '',
-        'tz_handling' => 'site',
-      ),
-      'translatable' => '1',
-      'type' => 'date',
-    ),
-    'field_instance' => array(
-      'bundle' => 'date_migrate_example',
-      'deleted' => '0',
-      'description' => '',
-      'display' => array(
-        'default' => array(
-          'label' => 'above',
-          'module' => 'date',
-          'settings' => array(
-            'format_type' => 'medium',
-            'fromto' => 'both',
-            'multiple_from' => '',
-            'multiple_number' => '',
-            'multiple_to' => '',
-            'show_repeat_rule' => 'show',
-          ),
-          'type' => 'date_default',
-          'weight' => '7',
-        ),
-        'teaser' => array(
-          'label' => 'above',
-          'settings' => array(),
-          'type' => 'hidden',
-          'weight' => 0,
-        ),
-      ),
-      'entity_type' => 'node',
-      'field_name' => 'field_date_repeat',
-      'label' => 'Date with repeat',
-      'required' => 0,
-      'settings' => array(
-        'default_format' => 'medium',
-        'default_value' => 'now',
-        'default_value2' => 'blank',
-        'default_value_code' => '',
-        'default_value_code2' => '',
-        'repeat_collapsed' => '0',
-        'user_register_form' => FALSE,
-      ),
-      'widget' => array(
-        'active' => 1,
-        'module' => 'date',
-        'settings' => array(
-          'increment' => 1,
-          'input_format' => 'm/d/Y - H:i:s',
-          'input_format_custom' => '',
-          'label_position' => 'above',
-          'repeat_collapsed' => 0,
-          'text_parts' => array(),
-          'year_range' => '-3:+3',
-        ),
-        'type' => 'date_text_repeat',
-        'weight' => '8',
-      ),
-    ),
-  );
-
-  // Exported field: 'node-date_migrate_example-field_datestamp'
-  $fields['node-date_migrate_example-field_datestamp'] = array(
-    'field_config' => array(
-      'active' => '1',
-      'cardinality' => '1',
-      'deleted' => '0',
-      'entity_types' => array(),
-      'field_name' => 'field_datestamp',
-      'foreign keys' => array(),
-      'indexes' => array(),
-      'module' => 'date',
-      'settings' => array(
-        'granularity' => array(
-          'day' => 'day',
-          'hour' => 'hour',
-          'minute' => 'minute',
-          'month' => 'month',
-          'year' => 'year',
-        ),
-        'repeat' => 0,
-        'timezone_db' => 'UTC',
-        'todate' => '',
-        'tz_handling' => 'site',
-      ),
-      'translatable' => '1',
-      'type' => 'datestamp',
-    ),
-    'field_instance' => array(
-      'bundle' => 'date_migrate_example',
-      'deleted' => '0',
-      'description' => '',
-      'display' => array(
-        'default' => array(
-          'label' => 'above',
-          'module' => 'date',
-          'settings' => array(
-            'format_type' => 'medium',
-            'fromto' => 'both',
-            'multiple_from' => '',
-            'multiple_number' => '',
-            'multiple_to' => '',
-            'show_repeat_rule' => 'show',
-          ),
-          'type' => 'date_default',
-          'weight' => '3',
-        ),
-        'teaser' => array(
-          'label' => 'above',
-          'settings' => array(),
-          'type' => 'hidden',
-          'weight' => 0,
-        ),
-      ),
-      'entity_type' => 'node',
-      'field_name' => 'field_datestamp',
-      'label' => 'Datestamp',
-      'required' => 0,
-      'settings' => array(
-        'default_format' => 'medium',
-        'default_value' => 'now',
-        'default_value2' => 'blank',
-        'default_value_code' => '',
-        'default_value_code2' => '',
-        'user_register_form' => FALSE,
-      ),
-      'widget' => array(
-        'active' => 1,
-        'module' => 'date',
-        'settings' => array(
-          'increment' => 1,
-          'input_format' => 'm/d/Y - H:i:s',
-          'input_format_custom' => '',
-          'label_position' => 'above',
-          'repeat_collapsed' => 0,
-          'text_parts' => array(),
-          'year_range' => '-3:+3',
-        ),
-        'type' => 'date_text',
-        'weight' => '4',
-      ),
-    ),
-  );
-
-  // Exported field: 'node-migrate_example_date-field_datestamp_range'
-  $fields['node-date_migrate_example-field_datestamp_range'] = array(
-    'field_config' => array(
-      'active' => '1',
-      'cardinality' => '1',
-      'deleted' => '0',
-      'entity_types' => array(),
-      'field_name' => 'field_datestamp_range',
-      'foreign keys' => array(),
-      'indexes' => array(),
-      'module' => 'date',
-      'settings' => array(
-        'granularity' => array(
-          'day' => 'day',
-          'hour' => 'hour',
-          'minute' => 'minute',
-          'month' => 'month',
-          'year' => 'year',
-        ),
-        'repeat' => 0,
-        'timezone_db' => 'UTC',
-        'todate' => 'optional',
-        'tz_handling' => 'site',
-      ),
-      'translatable' => '1',
-      'type' => 'datestamp',
-    ),
-    'field_instance' => array(
-      'bundle' => 'date_migrate_example',
-      'deleted' => '0',
-      'description' => '',
-      'display' => array(
-        'default' => array(
-          'label' => 'above',
-          'module' => 'date',
-          'settings' => array(
-            'format_type' => 'medium',
-            'fromto' => 'both',
-            'multiple_from' => '',
-            'multiple_number' => '',
-            'multiple_to' => '',
-            'show_repeat_rule' => 'show',
-          ),
-          'type' => 'date_default',
-          'weight' => '4',
-        ),
-        'teaser' => array(
-          'label' => 'above',
-          'settings' => array(),
-          'type' => 'hidden',
-          'weight' => 0,
-        ),
-      ),
-      'entity_type' => 'node',
-      'field_name' => 'field_datestamp_range',
-      'label' => 'Datestamp range',
-      'required' => 0,
-      'settings' => array(
-        'default_format' => 'medium',
-        'default_value' => 'now',
-        'default_value2' => 'strtotime',
-        'default_value_code' => '',
-        'default_value_code2' => '+3 months',
-        'user_register_form' => FALSE,
-      ),
-      'widget' => array(
-        'active' => 1,
-        'module' => 'date',
-        'settings' => array(
-          'increment' => '1',
-          'input_format' => 'm/d/Y - H:i:s',
-          'input_format_custom' => '',
-          'label_position' => 'above',
-          'repeat_collapsed' => 0,
-          'text_parts' => array(),
-          'year_range' => '-3:+3',
-        ),
-        'type' => 'date_select',
-        'weight' => '5',
-      ),
-    ),
-  );
-
-  // Exported field: 'node-date_migrate_example-field_datetime'
-  $fields['node-date_migrate_example-field_datetime'] = array(
-    'field_config' => array(
-      'active' => '1',
-      'cardinality' => '1',
-      'deleted' => '0',
-      'entity_types' => array(),
-      'field_name' => 'field_datetime',
-      'foreign keys' => array(),
-      'indexes' => array(),
-      'module' => 'date',
-      'settings' => array(
-        'granularity' => array(
-          'day' => 'day',
-          'hour' => 'hour',
-          'minute' => 'minute',
-          'month' => 'month',
-          'year' => 'year',
-        ),
-        'repeat' => 0,
-        'timezone_db' => 'UTC',
-        'todate' => '',
-        'tz_handling' => 'site',
-      ),
-      'translatable' => '1',
-      'type' => 'datetime',
-    ),
-    'field_instance' => array(
-      'bundle' => 'date_migrate_example',
-      'deleted' => '0',
-      'description' => '',
-      'display' => array(
-        'default' => array(
-          'label' => 'above',
-          'module' => 'date',
-          'settings' => array(
-            'format_type' => 'medium',
-            'fromto' => 'both',
-            'multiple_from' => '',
-            'multiple_number' => '',
-            'multiple_to' => '',
-            'show_repeat_rule' => 'show',
-          ),
-          'type' => 'date_default',
-          'weight' => '5',
-        ),
-        'teaser' => array(
-          'label' => 'above',
-          'settings' => array(),
-          'type' => 'hidden',
-          'weight' => 0,
-        ),
-      ),
-      'entity_type' => 'node',
-      'field_name' => 'field_datetime',
-      'label' => 'Datetime',
-      'required' => 0,
-      'settings' => array(
-        'default_format' => 'medium',
-        'default_value' => 'now',
-        'default_value2' => 'blank',
-        'default_value_code' => '',
-        'default_value_code2' => '',
-        'user_register_form' => FALSE,
-      ),
-      'widget' => array(
-        'active' => 1,
-        'module' => 'date',
-        'settings' => array(
-          'increment' => 1,
-          'input_format' => 'm/d/Y - H:i:s',
-          'input_format_custom' => '',
-          'label_position' => 'above',
-          'repeat_collapsed' => 0,
-          'text_parts' => array(),
-          'year_range' => '-3:+3',
-        ),
-        'type' => 'date_text',
-        'weight' => '6',
-      ),
-    ),
-  );
-
-  // Exported field: 'node-date_migrate_example-field_datetime_range'
-  $fields['node-date_migrate_example-field_datetime_range'] = array(
-    'field_config' => array(
-      'active' => '1',
-      'cardinality' => '1',
-      'deleted' => '0',
-      'entity_types' => array(),
-      'field_name' => 'field_datetime_range',
-      'foreign keys' => array(),
-      'indexes' => array(),
-      'module' => 'date',
-      'settings' => array(
-        'granularity' => array(
-          'day' => 'day',
-          'hour' => 'hour',
-          'minute' => 'minute',
-          'month' => 'month',
-          'year' => 'year',
-        ),
-        'repeat' => 0,
-        'timezone_db' => 'UTC',
-        'todate' => 'required',
-        'tz_handling' => 'site',
-      ),
-      'translatable' => '1',
-      'type' => 'datetime',
-    ),
-    'field_instance' => array(
-      'bundle' => 'date_migrate_example',
-      'deleted' => '0',
-      'description' => '',
-      'display' => array(
-        'default' => array(
-          'label' => 'above',
-          'module' => 'date',
-          'settings' => array(
-            'format_type' => 'medium',
-            'fromto' => 'both',
-            'multiple_from' => '',
-            'multiple_number' => '',
-            'multiple_to' => '',
-            'show_repeat_rule' => 'show',
-          ),
-          'type' => 'date_default',
-          'weight' => '6',
-        ),
-        'teaser' => array(
-          'label' => 'above',
-          'settings' => array(),
-          'type' => 'hidden',
-          'weight' => 0,
-        ),
-      ),
-      'entity_type' => 'node',
-      'field_name' => 'field_datetime_range',
-      'label' => 'Datetime range',
-      'required' => 0,
-      'settings' => array(
-        'default_format' => 'medium',
-        'default_value' => 'now',
-        'default_value2' => 'blank',
-        'default_value_code' => '',
-        'default_value_code2' => '+1 year',
-        'user_register_form' => FALSE,
-      ),
-      'widget' => array(
-        'active' => 1,
-        'module' => 'date',
-        'settings' => array(
-          'increment' => 1,
-          'input_format' => 'm/d/Y - H:i:s',
-          'input_format_custom' => '',
-          'label_position' => 'above',
-          'repeat_collapsed' => 0,
-          'text_parts' => array(),
-          'year_range' => '-3:+3',
-        ),
-        'type' => 'date_text',
-        'weight' => '7',
-      ),
-    ),
-  );
-
-  // Translatables
-  // Included for use with string extractors like potx.
-  t('Body');
-  t('Date');
-  t('Date range');
-  t('Date with repeat');
-  t('Datestamp');
-  t('Datestamp range');
-  t('Datetime');
-  t('Datetime range');
-
-  return $fields;
-}
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
deleted file mode 100644
index ba07220d..00000000
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info
+++ /dev/null
@@ -1,28 +0,0 @@
-core = "7.x"
-dependencies[] = "date"
-dependencies[] = "date_repeat"
-dependencies[] = "date_repeat_field"
-dependencies[] = "features"
-dependencies[] = "migrate"
-description = "Examples of migrating with the Date module"
-features[field][] = "node-date_migrate_example-body"
-features[field][] = "node-date_migrate_example-field_date"
-features[field][] = "node-date_migrate_example-field_date_range"
-features[field][] = "node-date_migrate_example-field_date_repeat"
-features[field][] = "node-date_migrate_example-field_datestamp"
-features[field][] = "node-date_migrate_example-field_datestamp_range"
-features[field][] = "node-date_migrate_example-field_datetime"
-features[field][] = "node-date_migrate_example-field_datetime_range"
-features[node][] = "date_migrate_example"
-files[] = date_migrate_example.migrate.inc
-name = "Date Migration Example"
-package = "Features"
-project = "date_migrate_example"
-version = "7.x-2.0"
-
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
-core = "7.x"
-project = "date"
-datestamp = "1491562090"
-
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
deleted file mode 100644
index d202bd05..00000000
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.install
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-/**
- * @file
- * Install, update and uninstall functions for the Date Migrate Example module.
- */
-
-/**
- * Implements hook_disable().
- */
-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_popup/README.txt b/drupal7/sites/all/modules/date/date_popup/README.txt
index 7a66628b..82c58898 100644
--- a/drupal7/sites/all/modules/date/date_popup/README.txt
+++ b/drupal7/sites/all/modules/date/date_popup/README.txt
@@ -36,6 +36,10 @@ jquery.timepicker-1.1.2.js and jquery.timepicker-1.1.2.css. Rename them to
 jquery.timepicker.js and jquery.timepicker.css and copy them into
 'sites/all/libraries/wvega-timepicker'.
 
+The date_popup_timepicker module is also supported:
+* https://www.drupal.org/project/date_popup_timepicker
+
+
 ================================================================================
 Usage
 ================================================================================
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 41945a63..c0a46cf2 100644
--- a/drupal7/sites/all/modules/date/date_popup/date_popup.info
+++ b/drupal7/sites/all/modules/date/date_popup/date_popup.info
@@ -1,15 +1,20 @@
 name = Date Popup
 description = Enables jquery popup calendars and time entry widgets for selecting dates and times.
-dependencies[] = date_api
 package = Date/Time
 core = 7.x
 configure = admin/config/date/date_popup
 
-stylesheets[all][] = themes/datepicker.1.7.css
+; Only the Date API module is required.
+dependencies[] = date:date_api
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+; Test coverage.
+; @todo Replicate DateUiTestCase::testFieldUI().
+files[] = tests/DatePopupFieldTestCase.test
+files[] = tests/DatePopupValidationTestCase.test
+files[] = tests/DatePopupWithViewsTestCase.test
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date_popup/date_popup.install b/drupal7/sites/all/modules/date/date_popup/date_popup.install
deleted file mode 100644
index e13a4f5a..00000000
--- a/drupal7/sites/all/modules/date/date_popup/date_popup.install
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
- * @file
- * Install, update and uninstall functions for the Date Popup module.
- */
-
-// @codingStandardsIgnoreStart
-/**
- * Implements hook_install().
- */
-function date_popup_install() {
-}
-
-/**
- * Implements hook_uninstall().
- */
-function date_popup_uninstall() {
-
-}
-// @codingStandardsIgnoreEnd
-
-/**
- * Implements hook_enable().
- */
-function date_popup_enable() {
-
-}
-
-/**
- * Implements hook_disable().
- */
-function date_popup_disable() {
-
-}
diff --git a/drupal7/sites/all/modules/date/date_popup/date_popup.js b/drupal7/sites/all/modules/date/date_popup/date_popup.js
index f38dcb59..3730c3d3 100644
--- a/drupal7/sites/all/modules/date/date_popup/date_popup.js
+++ b/drupal7/sites/all/modules/date/date_popup/date_popup.js
@@ -1,6 +1,8 @@
 /**
- * Attaches the calendar behavior to all required fields
+ * @file
+ * Attaches the calendar behavior to all required fields.
  */
+
 (function($) {
   function makeFocusHandler(e) {
     if (!$(this).hasClass('date-popup-init')) {
@@ -10,10 +12,8 @@
         case 'datepicker':
           $(this)
             .datepicker(datePopup.settings)
-            .addClass('date-popup-init');
-          $(this).click(function(){
-            $(this).focus();
-          });
+            .addClass('date-popup-init')
+            .focus();
           if (datePopup.settings.syncEndDate) {
             $('.start-date-wrapper').each(function(){
               var start_date_wrapper = this;
@@ -27,10 +27,8 @@
         case 'timeEntry':
           $(this)
             .timeEntry(datePopup.settings)
-            .addClass('date-popup-init');
-          $(this).click(function(){
-            $(this).focus();
-          });
+            .addClass('date-popup-init')
+            .focus();
           break;
 
         case 'timepicker':
@@ -54,10 +52,8 @@
           datePopup.settings.startTime = new Date(datePopup.settings.startTime);
           $(this)
             .timepicker(datePopup.settings)
-            .addClass('date-popup-init');
-          $(this).click(function(){
-            $(this).focus();
-          });
+            .addClass('date-popup-init')
+            .focus();
           break;
       }
     }
@@ -66,8 +62,9 @@
   Drupal.behaviors.date_popup = {
     attach: function (context) {
       for (var id in Drupal.settings.datePopup) {
-        $('#'+ id).bind('focus', Drupal.settings.datePopup[id], makeFocusHandler);
+        $('#' + id).bind('focus', Drupal.settings.datePopup[id], makeFocusHandler);
       }
     }
   };
+
 })(jQuery);
diff --git a/drupal7/sites/all/modules/date/date_popup/date_popup.module b/drupal7/sites/all/modules/date/date_popup/date_popup.module
index a03132e9..89fcf15a 100644
--- a/drupal7/sites/all/modules/date/date_popup/date_popup.module
+++ b/drupal7/sites/all/modules/date/date_popup/date_popup.module
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * A module to enable jquery calendar and time entry popups.
@@ -49,8 +50,10 @@ function date_popup_add() {
 function date_popup_get_wvega_path() {
   $path = FALSE;
   if (function_exists('libraries_get_path')) {
+    // Try loading the wvega timepicker library.
     $path = libraries_get_path('wvega-timepicker');
-    if (!file_exists($path)) {
+    // Check if the library actually exists.
+    if (empty($path) || !file_exists($path)) {
       $path = FALSE;
     }
   }
@@ -107,12 +110,10 @@ function date_popup_library() {
  *
  * @param string $id
  *   The CSS class prefix to search the DOM for.
- *   TODO : unused ?
- *
+ *   @todo unused ?
  * @param string $func
  *   The jQuery function to invoke on each DOM element
  *   containing the returned CSS class.
- *
  * @param array $settings
  *   The settings array to pass to the jQuery function.
  *
@@ -127,9 +128,9 @@ function date_popup_js_settings_id($id, $func, $settings) {
   // Make sure popup date selector grid is in correct year.
   if (!empty($settings['yearRange'])) {
     $parts = explode(':', $settings['yearRange']);
-    // Set the default date to 0 or the lowest bound if
-    // the date ranges do not include the current year.
-    // Necessary for the datepicker to render and select dates correctly.
+    // Set the default date to 0 or the lowest bound if the date ranges do not
+    // include the current year. Necessary for the datepicker to render and
+    // select dates correctly.
     $default_date = ($parts[0] > 0 || 0 > $parts[1]) ? $parts[0] : 0;
     $settings += array('defaultDate' => (string) $default_date . 'y');
   }
@@ -145,9 +146,8 @@ function date_popup_js_settings_id($id, $func, $settings) {
     $id_count[$id] = 0;
   }
 
-  // It looks like we need the additional id_count for this to
-  // work correctly when there are multiple values.
-  // $return_id = "$id-$func-popup";
+  // It looks like we need the additional id_count for this to work correctly
+  // when there are multiple values.
   $return_id = "$id-$func-popup-" . $id_count[$id]++;
   $js_settings['datePopup'][$return_id] = array(
     'func' => $func,
@@ -170,44 +170,44 @@ function date_popup_theme() {
 
 /**
  * Implements hook_element_info().
- *
- * Set the #type to date_popup and fill the element #default_value with
- * a date adjusted to the proper local timezone in datetime format
- * (YYYY-MM-DD HH:MM:SS).
- *
- * The element will create two textfields, one for the date and one for the
- * time. The date textfield will include a jQuery popup calendar date picker,
- * and the time textfield uses a jQuery timepicker.
- *
- * NOTE - Converting a date stored in the database from UTC to the local zone
- * and converting it back to UTC before storing it is not handled by this
- * element and must be done in pre-form and post-form processing!!
- *
- * #date_timezone
- *   The local timezone to be used to create this date.
- *
- * #date_format
- *   Unlike earlier versions of this popup, most formats will work.
- *
- * #date_increment
- *   Increment minutes and seconds by this amount, default is 1.
- *
- * #date_year_range
- *   The number of years to go back and forward in a year selector,
- *   default is -3:+3 (3 back and 3 forward).
- *
- * #datepicker_options
- *   An associative array representing the jQuery datepicker options you want
- *   to set for this element. Use the jQuery datepicker option names as keys.
- *   Hard coded defaults are:
- *   - changeMonth => TRUE
- *   - changeYear => TRUE
- *   - autoPopUp => 'focus'
- *   - closeAtTop => FALSE
- *   - speed => 'immediate'
  */
 function date_popup_element_info() {
   $timepicker = date_popup_get_preferred_timepicker();
+
+  // Set the #type to date_popup and fill the element #default_value with
+  // a date adjusted to the proper local timezone in datetime format
+  // (YYYY-MM-DD HH:MM:SS).
+  //
+  // The element will create two textfields, one for the date and one for the
+  // time. The date textfield will include a jQuery popup calendar date picker,
+  // and the time textfield uses a jQuery timepicker.
+  //
+  // NOTE - Converting a date stored in the database from UTC to the local zone
+  // and converting it back to UTC before storing it is not handled by this
+  // element and must be done in pre-form and post-form processing!!
+  //
+  // #date_timezone
+  //   The local timezone to be used to create this date.
+  //
+  // #date_format
+  //   Unlike earlier versions of this popup, most formats will work.
+  //
+  // #date_increment
+  //   Increment minutes and seconds by this amount, default is 1.
+  //
+  // #date_year_range
+  //   The number of years to go back and forward in a year selector,
+  //   default is -3:+3 (3 back and 3 forward).
+  //
+  // #datepicker_options
+  //   An associative array representing the jQuery datepicker options you want
+  //   to set for this element. Use the jQuery datepicker option names as keys.
+  //   Hard coded defaults are:
+  //   - changeMonth => TRUE
+  //   - changeYear => TRUE
+  //   - autoPopUp => 'focus'
+  //   - closeAtTop => FALSE
+  //   - speed => 'immediate'
   $type['date_popup'] = array(
     '#input' => TRUE,
     '#tree' => TRUE,
@@ -222,10 +222,15 @@ function date_popup_element_info() {
     '#process' => array('date_popup_element_process'),
     '#value_callback' => 'date_popup_element_value_callback',
     '#theme_wrappers' => array('date_popup'),
+    '#attached' => array('css' => array(
+      drupal_get_path('module', 'date_popup'). '/themes/datepicker.1.7.css',
+    )),
   );
+
   if (module_exists('ctools')) {
     $type['date_popup']['#pre_render'] = array('ctools_dependent_pre_render');
   }
+
   return $type;
 }
 
@@ -262,15 +267,14 @@ function date_popup_time_format($element) {
 /**
  * Element value callback for date_popup element.
  */
-// @codingStandardsIgnoreStart
 function date_popup_element_value_callback($element, $input = FALSE, &$form_state) {
   $granularity = date_format_order($element['#date_format']);
   $has_time = date_has_time($granularity);
   $date = NULL;
   $return = $has_time ? array('date' => '', 'time' => '') : array('date' => '');
-  // Normal input from submitting the form element.
-  // Check is_array() to skip the string input values created by Views pagers.
-  // Those string values, if present, should be interpreted as empty input.
+  // Normal input from submitting the form element. Check is_array() to skip
+  // the string input values created by Views pagers. Those string values, if
+  // present, should be interpreted as empty input.
   if ($input !== FALSE && is_array($input)) {
     $return = $input;
     $date = date_popup_input_date($element, $input);
@@ -290,7 +294,6 @@ function date_popup_element_value_callback($element, $input = FALSE, &$form_stat
   return $return;
 
 }
-// @codingStandardsIgnoreEnd
 
 /**
  * Javascript popup element processing.
@@ -357,21 +360,32 @@ function date_popup_process_date_part(&$element) {
     return array();
   }
 
-  // The datepicker can't handle zero or negative values like 0:+1
-  // even though the Date API can handle them, so rework the value
-  // we pass to the datepicker to use defaults it can accept (such as +0:+1)
+  // The datepicker can't handle zero or negative values like 0:+1 even though
+  // the Date API can handle them, so rework the value we pass to the
+  // datepicker to use defaults it can accept (such as +0:+1)
   // date_range_string() adds the necessary +/- signs to the range string.
   $this_year = date_format(date_now(), 'Y');
-  // When used as a Views exposed filter widget, $element['#value'] contains an array instead an string.
-  // Fill the 'date' string in this case.
+  // When used as a Views exposed filter widget, $element['#value'] contains an
+  // array instead an string. Fill the 'date' string in this case.
   $mock = NULL;
   $callback_values = date_popup_element_value_callback($element, FALSE, $mock);
   if (!isset($element['#value']['date']) && isset($callback_values['date'])) {
+    if (!is_array($element['#value'])) {
+      $element['#value'] = array();
+    }
     $element['#value']['date'] = $callback_values['date'];
   }
   $date = '';
   if (!empty($element['#value']['date'])) {
+    // @todo If date does not meet the granularity or format condtions, then
+    // $date will have error condtions and '#default_value' below will have the
+    // global default date (most likely formatted string from 'now'). There
+    // will be an validation error message referring to the actual input date
+    // but the form element will display formatted 'now'.
     $date = new DateObject($element['#value']['date'], $element['#date_timezone'], date_popup_date_format($element));
+    if (!date_is_date($date)) {
+      $date = '';
+    }
   }
   $range = date_range_years($element['#date_year_range'], $date);
   $year_range = date_range_string($range);
@@ -401,8 +415,11 @@ function date_popup_process_date_part(&$element) {
   // Create a unique id for each set of custom settings.
   $id = date_popup_js_settings_id($element['#id'], 'datepicker', $settings);
 
-  // Manually build this element and set the value -
-  // this will prevent corrupting the parent value.
+  // Manually build this element and set the value - this will prevent
+  // corrupting the parent value.
+  // Do NOT set '#input' => FALSE as this prevents the form API from recursing
+  // into this element (this was useful when the '#value' property was being
+  // overwritten by the '#default_value' property).
   $parents = array_merge($element['#parents'], array('date'));
   $sub_element = array(
     '#type' => 'textfield',
@@ -410,17 +427,16 @@ function date_popup_process_date_part(&$element) {
     '#title_display' => $element['#date_label_position'] == 'above' ? 'before' : 'invisible',
     '#default_value' => date_format_date($date, 'custom', date_popup_date_format($element)),
     '#id' => $id,
-    '#input' => FALSE,
     '#size' => !empty($element['#size']) ? $element['#size'] : 20,
     '#maxlength' => !empty($element['#maxlength']) ? $element['#maxlength'] : 30,
     '#attributes' => $element['#attributes'],
     '#parents' => $parents,
     '#name' => array_shift($parents) . '[' . implode('][', $parents) . ']',
     '#ajax' => !empty($element['#ajax']) ? $element['#ajax'] : FALSE,
+    '#required' => $element['#required'],
   );
-  $sub_element['#value'] = $sub_element['#default_value'];
-  // TODO, figure out exactly when we want this description.
-  // In many places it is not desired.
+  // Do NOT overwrite the actual input with the default value.
+  // @todo Figure out exactly when this is needed, in many places it is not.
   $sub_element['#description'] = ' ' . t('E.g., @date', array(
       '@date' => date_format_date(
         date_example_date(),
@@ -442,8 +458,8 @@ function date_popup_process_time_part(&$element) {
     return array();
   }
 
-  // When used as a Views exposed filter widget, $element['#value'] contains an array instead an string.
-  // Fill the 'time' string in this case.
+  // When used as a Views exposed filter widget, $element['#value'] contains an
+  // array instead an string. Fill the 'time' string in this case.
   $mock = NULL;
   $callback_values = date_popup_element_value_callback($element, FALSE, $mock);
   if (!isset($element['#value']['time']) && isset($callback_values['time'])) {
@@ -464,11 +480,17 @@ function date_popup_process_time_part(&$element) {
         'spinnerImage' => '',
         'fromTo' => isset($fromto),
       );
+
       if (strpos($element['#date_format'], 'a') !== FALSE) {
         // Then we are using lowercase am/pm.
-        $settings['ampmNames'] = array('am', 'pm');
+        $options = date_ampm_options(FALSE, FALSE);
+        $settings['ampmNames'] = array($options['am'], $options['pm']);
       }
-      if (strpos($element['#date_format'], ' A') !== FALSE || strpos($element['#date_format'], ' a') !== FALSE) {
+
+      if (strpos($element['#date_format'], 'A') !== FALSE) {
+        // Then we are using uppercase am/pm.
+        $options = date_ampm_options(FALSE, TRUE);
+        $settings['ampmNames'] = array($options['am'], $options['pm']);
         $settings['ampmPrefix'] = ' ';
       }
       break;
@@ -496,14 +518,13 @@ function date_popup_process_time_part(&$element) {
     default:
       $func = '';
       $settings = array();
-      break;
   }
 
   // Create a unique id for each set of custom settings.
   $id = date_popup_js_settings_id($element['#id'], $func, $settings);
 
-  // Manually build this element and set the value -
-  // this will prevent corrupting the parent value.
+  // Manually build this element and set the value - this will prevent
+  // corrupting the parent value.
   $parents = array_merge($element['#parents'], array('time'));
   $sub_element = array(
     '#type' => 'textfield',
@@ -517,12 +538,12 @@ function date_popup_process_time_part(&$element) {
     '#parents' => $parents,
     '#name' => array_shift($parents) . '[' . implode('][', $parents) . ']',
     '#ajax' => !empty($element['#ajax']) ? $element['#ajax'] : FALSE,
+    '#required' => $element['#required'],
   );
 
-  $sub_element['#value'] = $sub_element['#default_value'];
+  // Do NOT overwrite the actual input with the default value.
 
-  // TODO, figure out exactly when we want this description.
-  // In many places it is not desired.
+  // @todo Figure out exactly when this is needed, in many places it is not.
   $example_date = date_now();
   date_increment_round($example_date, $element['#date_increment']);
   $sub_element['#description'] = t('E.g., @date', array(
@@ -543,7 +564,6 @@ function date_popup_process_time_part(&$element) {
  * contains a string, after submission it contains an array.
  */
 function date_popup_validate($element, &$form_state) {
-
   if (date_hidden_element($element)) {
     return;
   }
@@ -581,9 +601,9 @@ function date_popup_validate($element, &$form_state) {
   // @codingStandardsIgnoreEnd
   $date = date_popup_input_date($element, $input);
 
-  // If the date has errors, display them.
-  // If something was input but there is no date, the date is invalid.
-  // If the field is empty and required, set error message and return.
+  // If the date has errors, display them. If something was input but there is
+  // no date, the date is invalid. If the field is empty and required, set
+  // error message and return.
   $error_field = implode('][', $element['#parents']);
   if ((empty($element['#value']['date']) && empty($element['#value']['time']))  || !empty($date->errors)) {
     if (is_object($date) && !empty($date->errors)) {
@@ -617,10 +637,8 @@ function date_popup_validate($element, &$form_state) {
  *   Useful anytime the time value is optional.
  */
 function date_popup_input_date($element, $input, $auto_complete = FALSE) {
-  if (empty($input) || !is_array($input) || !array_key_exists('date', $input) || empty($input['date'])) {
-    //check if there is no time associated in the input variable. This is the exception scenario where the user has entered only time and not date.
-    if(empty($input['time']))
-      return NULL;
+  if (empty($input) || !is_array($input) || !array_key_exists('date', $input) || (empty($input['date']) && empty($input['time']))) {
+    return NULL;
   }
   date_popup_add();
   $granularity = date_format_order($element['#date_format']);
@@ -629,12 +647,12 @@ function date_popup_input_date($element, $input, $auto_complete = FALSE) {
 
   $format = date_popup_date_format($element);
   $format .= $has_time ? ' ' . date_popup_time_format($element) : '';
-  //check if date is empty, if yes, then leave it blank.
+  // check if date is empty, if yes, then leave it blank.
   $datetime = !empty($input['date']) ? trim($input['date']) : '';
   $datetime .= $has_time ? ' ' . trim($input['time']) : '';
   $date = new DateObject($datetime, $element['#date_timezone'], $format);
-  //if the variable is time only then set TimeOnly to TRUE
-  if(empty($input['date']) && !empty($input['time']) ){
+  // if the variable is time only then set TimeOnly to TRUE.
+  if (empty($input['date']) && !empty($input['time'])) {
     $date->timeOnly = 'TRUE';
   }
   if (is_object($date)) {
@@ -660,7 +678,7 @@ function date_popup_time_formats($with_seconds = FALSE) {
 /**
  * Format options array.
  *
- * TODO Remove any formats not supported by the widget, if any.
+ * @todo Remove any formats not supported by the widget, if any.
  */
 function date_popup_formats() {
   // Load short date formats.
@@ -684,9 +702,8 @@ function date_popup_formats() {
  *   A normal date format string, like Y-m-d
  *
  * @return string
- *   A format string in popup format, like YMD-, for the
- *   earlier 'calendar' version, or m/d/Y for the later 'datepicker'
- *   version.
+ *   A format string in popup format, like YMD-, for the earlier 'calendar'
+ *   version, or m/d/Y for the later 'datepicker' version.
  */
 function date_popup_format_to_popup($format) {
   if (empty($format)) {
@@ -754,7 +771,7 @@ function date_popup_popup_to_format($format) {
  * input format into one that the given timepicker can support.
  *
  * @param string $timepicker
- *   The time entry plugin being used: either 'wvega' or 'default'.
+ *   The time entry plugin being used: 'wvega', 'timepicker' or 'default'.
  *
  * @return array
  *   A map of replacements.
@@ -765,6 +782,10 @@ function date_popup_timepicker_format_replacements($timepicker = 'default') {
       // The wvega timepicker only supports uppercase AM/PM.
       return array('a' => 'A');
 
+    case 'timepicker':
+      // The jquery_ui timepicker supports all possible date formats.
+      return array();
+
     default:
       // The default timeEntry plugin requires leading zeros.
       return array('G' => 'H', 'g' => 'h');
@@ -798,14 +819,14 @@ function theme_date_popup($vars) {
   $element = $vars['element'];
   $attributes = !empty($element['#wrapper_attributes']) ? $element['#wrapper_attributes'] : array('class' => array());
   $attributes['class'][] = 'container-inline-date';
-  // If there is no description, the floating date
-  // elements need some extra padding below them.
+  // If there is no description, the floating date elements need some extra
+  // padding below them.
   $wrapper_attributes = array('class' => array('date-padding'));
   if (empty($element['date']['#description'])) {
     $wrapper_attributes['class'][] = 'clearfix';
   }
-  // Add an wrapper to mimic the way a single value field works,
-  // for ease in using #states.
+  // Add an wrapper to mimic the way a single value field works, for ease in
+  // using #states.
   if (isset($element['#children'])) {
     $element['#children'] = '<div id="' . $element['#id'] . '" ' . drupal_attributes($wrapper_attributes) . '>' . $element['#children'] . '</div>';
   }
@@ -824,8 +845,7 @@ function date_popup_date_field_instance_settings_form_alter(&$form, $context) {
  * Implements hook_menu().
  */
 function date_popup_menu() {
-  $items = array();
-  // TODO Fix this later.
+  // @todo Fix this later.
   $items['admin/config/date/date_popup'] = array(
     'title' => 'Date Popup',
     'description' => 'Configure the Date Popup settings.',
@@ -836,6 +856,7 @@ function date_popup_menu() {
   );
   return $items;
 }
+
 /**
  * General configuration form for controlling the Date Popup behaviour.
  */
diff --git a/drupal7/sites/all/modules/date/date_popup/tests/DatePopupFieldTestCase.test b/drupal7/sites/all/modules/date/date_popup/tests/DatePopupFieldTestCase.test
new file mode 100644
index 00000000..84baf3d1
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_popup/tests/DatePopupFieldTestCase.test
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * @file
+ * Test the custom field functionality provided by the Date Popup module.
+ */
+
+/**
+ * Test the custom field functionality provided by the Date Popup module.
+ */
+class DatePopupFieldTestCase extends DateFieldTestBase {
+  
+  /**
+   * Define this test class.
+   */
+  public static function getInfo() {
+    return array(
+      'name' => t('Date Popup'),
+      'description' => t('Test the custom functionality of the Date Popup module.'),
+      'group' => t('Date'),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_popup';
+    parent::setUp($modules);
+
+    // Don't load the time picker.
+    // @todo Add test coverage for the time picker.
+    variable_set('date_popup_timepicker', 'none');
+  }
+
+  /**
+   * Test the field settings.
+   */
+  public function testField() {
+    // Test all base field types.
+    foreach (array('date', 'datestamp', 'datetime') as $field_type) {
+      // Add a Date Popup field to the 'story' content type, but don't remove
+      // it.
+      $this->checkDateField($field_type, 'date_popup', FALSE);
+
+      // Load the node form.
+      $this->drupalGet('node/add/story');
+      $this->assertResponse(200);
+
+      // Confirm the date field is present.
+      $this->assertFieldByName('field_test_date_popup[und][0][value][date]');
+      $this->assertFieldByName('field_test_date_popup[und][0][value][time]');
+
+      // Confirm the JS and CSS files were requested.
+      $this->assertRaw('date/date_popup/jquery.timeentry.pack.js');
+      $this->assertRaw('date/date_popup/themes/datepicker.1.7.css');
+      $this->assertRaw('date/date_popup/themes/jquery.timeentry.css');
+
+      // Now delete the field.
+      $this->deleteDateField('Test');
+    }
+  }
+
+}
diff --git a/drupal7/sites/all/modules/date/date_popup/tests/DatePopupValidationTestCase.test b/drupal7/sites/all/modules/date/date_popup/tests/DatePopupValidationTestCase.test
new file mode 100644
index 00000000..c6da3c31
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_popup/tests/DatePopupValidationTestCase.test
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * @file
+ * Data validation tests for the Date Popup module.
+ */
+
+/**
+ * Data validation tests for the Date Popup module.
+ */
+class DatePopupValidationTestCase extends DateValidationTestCase {
+
+  /**
+   * @todo.
+   */
+  // public static function getInfo() {
+  //   return array(
+  //     'name' => 'Date Popup Validation',
+  //     'description' => 'Data validation tests for the Date Popup module.',
+  //     'group' => 'Date',
+  //   );
+  // }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_popup';
+    parent::setUp($modules);
+  }
+
+  /**
+   * Validate the Date Popup fields.
+   */
+  public function testValidation() {
+    // Attempts to create text date field stored as a date with default settings
+    // (from input which is not valid).
+    foreach (array('date', 'datestamp', 'datetime') as $field_type) {
+      $this->checkDateField($field_type, 'date_popup', TRUE);
+      return;
+    }
+  }
+
+}
\ No newline at end of file
diff --git a/drupal7/sites/all/modules/date/tests/date_views_popup.test b/drupal7/sites/all/modules/date/date_popup/tests/DateViewsPopupTestCase.test
similarity index 88%
rename from drupal7/sites/all/modules/date/tests/date_views_popup.test
rename to drupal7/sites/all/modules/date/date_popup/tests/DateViewsPopupTestCase.test
index e3d4306d..83005047 100644
--- a/drupal7/sites/all/modules/date/tests/date_views_popup.test
+++ b/drupal7/sites/all/modules/date/date_popup/tests/DateViewsPopupTestCase.test
@@ -2,10 +2,13 @@
 
 /**
  * @file
- * Tests date popup in Views
+ * Tests Date Popup in the Views interface.
  */
 
-class DateViewsPopupTestCase extends DateFieldBasic {
+/**
+ * Tests Date Popup in the Views interface.
+ */
+class DatePopupWithViewsTestCase extends DateFieldTestBase {
   /**
    * Test info.
    */
@@ -14,18 +17,20 @@ class DateViewsPopupTestCase extends DateFieldBasic {
       'name' => 'Date Views - Popup Test',
       'description' => 'Tests date popup in Views',
       'group' => 'Date',
+      'dependencies' => array('ctools', 'views'),
     );
   }
 
   /**
-   * Test setup actions.
+   * {@inheritdoc}
    */
-  public function setUp() {
-    parent::setUp();
-    // Load the 'date_popup', 'date_views', 'views', 'views_ui', 'ctools' modules.
-    $modules = array('date_popup', 'date_views', 'views', 'views_ui', 'ctools');
-    $success = module_enable($modules, TRUE);
-    $this->assertTrue($success, t('Enabled modules: %modules', array('%modules' => implode(', ', $modules))));
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_popup';
+    $modules[] = 'date_views';
+    $modules[] = 'ctools';
+    $modules[] = 'views';
+    $modules[] = 'views_ui';
+    parent::setUp($modules);
 
     // Reset/rebuild all data structures after enabling the modules.
     $this->resetAll();
@@ -57,7 +62,7 @@ class DateViewsPopupTestCase extends DateFieldBasic {
     $view->human_name = 'Test date_popup';
     $view->core = 7;
     $view->api_version = '3.0';
-    $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+    $view->disabled = FALSE; /* Edit this to TRUE to make a default view disabled initially */
 
     /* Display: Master */
     $handler = $view->new_display('default', 'Master', 'default');
@@ -103,4 +108,5 @@ class DateViewsPopupTestCase extends DateFieldBasic {
     // Go to view page.
     $this->drupalGet('test-date-popup');
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/date_popup/themes/datepicker.1.7.css b/drupal7/sites/all/modules/date/date_popup/themes/datepicker.1.7.css
index d386c985..68faf0eb 100644
--- a/drupal7/sites/all/modules/date/date_popup/themes/datepicker.1.7.css
+++ b/drupal7/sites/all/modules/date/date_popup/themes/datepicker.1.7.css
@@ -1,59 +1,188 @@
 #ui-datepicker-div {
-font-size: 100%;
-font-family: Verdana, sans-serif;
-background: #eee;
-border-right:2px #666 solid;
-border-bottom:2px #666 solid;
-z-index: 9999;
+  font-size: 100%;
+  font-family: Verdana, sans-serif;
+  background: #eee;
+  border-right: 2px #666 solid;
+  border-bottom: 2px #666 solid;
+  z-index: 9999;
 }
 
 /* Datepicker
 ----------------------------------*/
-.ui-datepicker { width: 17em; padding: .2em .2em 0; }
-.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
-.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
-.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
-.ui-datepicker .ui-datepicker-prev { left:2px; }
-.ui-datepicker .ui-datepicker-next { right:2px; }
-.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
-.ui-datepicker .ui-datepicker-next-hover { right:1px; }
-.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
-.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
-.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
-.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker {
+  width: auto;
+  padding: .2em .2em 0;
+}
+.ui-datepicker .ui-datepicker-header {
+  position: relative;
+  padding: .2em 0;
+}
+.ui-datepicker .ui-datepicker-prev,
+.ui-datepicker .ui-datepicker-next {
+  position: absolute;
+  top: 2px;
+  width: 1.8em;
+  height: 1.8em;
+}
+.ui-datepicker .ui-datepicker-prev-hover,
+.ui-datepicker .ui-datepicker-next-hover {
+  top: 1px;
+}
+.ui-datepicker .ui-datepicker-prev {
+  left: 2px;
+}
+.ui-datepicker .ui-datepicker-next {
+  right: 2px;
+}
+.ui-datepicker .ui-datepicker-prev-hover {
+  left: 1px;
+}
+.ui-datepicker .ui-datepicker-next-hover {
+  right: 1px;
+}
+.ui-datepicker .ui-datepicker-prev span,
+.ui-datepicker .ui-datepicker-next span {
+  display: block;
+  position: absolute;
+  left: 50%;
+  margin-left: -8px;
+  top: 50%;
+  margin-top: -8px;
+}
+.ui-datepicker .ui-datepicker-title {
+  margin: 0 2.3em;
+  line-height: 1.8em;
+  text-align: center;
+}
+.ui-datepicker .ui-datepicker-title select {
+  float: left;
+  font-size: 1em;
+  margin: 1px 0;
+}
+.ui-datepicker select.ui-datepicker-month-year {
+  width: 100%;
+}
 .ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
-.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
-.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
-.ui-datepicker td { border: 0; padding: 1px; }
-.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
-.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+.ui-datepicker select.ui-datepicker-year {
+  width: 49%;
+}
+.ui-datepicker .ui-datepicker-title select.ui-datepicker-year {
+  float: right;
+}
+.ui-datepicker table {
+  width: 100%;
+  font-size: .9em;
+  border-collapse: collapse;
+  margin: 0 0 .4em;
+}
+.ui-datepicker th {
+  padding: .7em .3em;
+  text-align: center;
+  font-weight: bold;
+  border: 0;
+}
+.ui-datepicker td {
+  border: 0;
+  padding: 1px;
+}
+.ui-datepicker td span,
+.ui-datepicker td a {
+  display: block;
+  padding: .2em;
+  text-align: right;
+  text-decoration: none;
+}
+.ui-datepicker .ui-datepicker-buttonpane {
+  background-image: none;
+  margin: .7em 0 0 0;
+  padding: 0 .2em;
+  border-left: 0;
+  border-right: 0;
+  border-bottom: 0;
+}
+.ui-datepicker .ui-datepicker-buttonpane button {
+  float: right;
+  margin: .5em .2em .4em;
+  cursor: pointer;
+  padding: .2em .6em .3em .6em;
+  width: auto;
+  overflow: visible;
+}
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
+  float: left;
+}
 
 /* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi { width:auto; }
-.ui-datepicker-multi .ui-datepicker-group { float:left; }
-.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
-.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
-.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
-.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; }
+.ui-datepicker.ui-datepicker-multi {
+  width: auto;
+}
+.ui-datepicker-multi .ui-datepicker-group {
+  float: left;
+}
+.ui-datepicker-multi .ui-datepicker-group table {
+  width: 95%;
+  margin: 0 auto .4em;
+}
+.ui-datepicker-multi-2 .ui-datepicker-group {
+  width: 50%;
+}
+.ui-datepicker-multi-3 .ui-datepicker-group {
+  width: 33.3%;
+}
+.ui-datepicker-multi-4 .ui-datepicker-group {
+  width: 25%;
+}
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header {
+  border-left-width: 0;
+}
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
+  border-left-width: 0;
+}
+.ui-datepicker-multi .ui-datepicker-buttonpane {
+  clear: left;
+}
+.ui-datepicker-row-break {
+  clear: both;
+  width: 100%;
+}
 
 /* RTL support */
-.ui-datepicker-rtl { direction: rtl; }
-.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-
+.ui-datepicker-rtl {
+  direction: rtl;
+}
+.ui-datepicker-rtl .ui-datepicker-prev {
+  right: 2px;
+  left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next {
+  left: 2px;
+  right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-prev:hover {
+  right: 1px;
+  left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next:hover {
+  left: 1px;
+  right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane {
+  clear: right;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button {
+  float: left;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current {
+  float: right;
+}
+.ui-datepicker-rtl .ui-datepicker-group {
+  float: right;
+}
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header {
+  border-right-width: 0;
+  border-left-width: 1px;
+}
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
+  border-right-width: 0;
+  border-left-width: 1px;
+}
diff --git a/drupal7/sites/all/modules/date/date_popup/themes/jquery.timeentry.css b/drupal7/sites/all/modules/date/date_popup/themes/jquery.timeentry.css
index 7ddefbac..96f94e13 100644
--- a/drupal7/sites/all/modules/date/date_popup/themes/jquery.timeentry.css
+++ b/drupal7/sites/all/modules/date/date_popup/themes/jquery.timeentry.css
@@ -1,8 +1,8 @@
 /* TimeEntry styles */
 .timeEntry_control {
-vertical-align: middle;
-margin-left: 2px;
+  vertical-align: middle;
+  margin-left: 2px;
 }
 * html .timeEntry_control { /* IE only */
-margin-top: -4px;
+  margin-top: -4px;
 }
diff --git a/drupal7/sites/all/modules/date/date_repeat.inc b/drupal7/sites/all/modules/date/date_repeat.inc
index 046d8aee..8d56c70c 100644
--- a/drupal7/sites/all/modules/date/date_repeat.inc
+++ b/drupal7/sites/all/modules/date/date_repeat.inc
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Empty file to avoid fatal error if it doesn't exist.
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 0a63175c..dbad355d 100644
--- a/drupal7/sites/all/modules/date/date_repeat/date_repeat.info
+++ b/drupal7/sites/all/modules/date/date_repeat/date_repeat.info
@@ -1,15 +1,16 @@
 name = Date Repeat API
 description = A Date Repeat API to calculate repeating dates and times from iCal rules.
-dependencies[] = date_api
 package = Date/Time
 core = 7.x
 php = 5.2
+
+dependencies[] = date:date_api
+
 files[] = tests/date_repeat.test
 files[] = tests/date_repeat_form.test
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date_repeat/date_repeat.module b/drupal7/sites/all/modules/date/date_repeat/date_repeat.module
index 61d971ba..d319c51a 100644
--- a/drupal7/sites/all/modules/date/date_repeat/date_repeat.module
+++ b/drupal7/sites/all/modules/date/date_repeat/date_repeat.module
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * This module creates a form element that allows users to select
@@ -70,9 +71,9 @@ function date_repeat_interval_options() {
 /**
  * Helper function for FREQ options.
  *
- * Translated and untranslated arrays of the iCal day of week names.
- * We need the untranslated values for date_modify(), translated
- * values when displayed to user.
+ * Translated and untranslated arrays of the iCal day of week names. We need the
+ * untranslated values for date_modify(), translated values when displayed to
+ * user.
  */
 function date_repeat_dow_day_options($translated = TRUE) {
   return array(
@@ -104,7 +105,6 @@ function date_repeat_dow_day_options_abbr($translated = TRUE, $length = 3) {
 
     default:
       $context = '';
-      break;
   }
   foreach (date_repeat_dow_day_untranslated() as $key => $day) {
     $return[$key] = $translated ? t(substr($day, 0, $length), array(), array('context' => $context)) : substr($day, 0, $length);
@@ -125,7 +125,7 @@ function date_repeat_dow_day_untranslated() {
       'WE' => 'Wednesday',
       'TH' => 'Thursday',
       'FR' => 'Friday',
-      'SA' => 'Saturday'
+      'SA' => 'Saturday',
     );
   }
   return $date_repeat_weekdays;
@@ -157,7 +157,7 @@ function date_repeat_dow_count_options() {
 /**
  * Helper function for BYDAY options.
  *
- * Creates options like -1SU and 2TU
+ * Creates options like -1SU and 2TU.
  */
 function date_repeat_dow_options() {
   $options = array();
@@ -172,8 +172,8 @@ function date_repeat_dow_options() {
 /**
  * Translate a day of week position to the iCal day name.
  *
- * Used with date_format($date, 'w') or get_variable('date_first_day'),
- * which return 0 for Sunday, 1 for Monday, etc.
+ * Used with date_format($date, 'w') or get_variable('date_first_day'), which
+ * return 0 for Sunday, 1 for Monday, etc.
  *
  * dow 2 becomes 'TU', dow 3 becomes 'WE', and so on.
  */
@@ -183,7 +183,9 @@ function date_repeat_dow2day($dow) {
 }
 
 /**
- * Shift the array of iCal day names into the right order for a specific week start day.
+ * Shift the array of iCal day names into the right order.
+ *
+ * @param $week_start_day
  */
 function date_repeat_days_ordered($week_start_day) {
   $days = array_flip(array_keys(date_repeat_dow_day_options(FALSE)));
@@ -247,7 +249,6 @@ function date_repeat_rrule_description($rrule, $format = 'D M d Y') {
 
     default:
       $description['!interval'] = format_plural($rrule['INTERVAL'], 'every day', 'every @count days') . ' ';
-      break;
   }
 
   if (!empty($rrule['BYDAY'])) {
@@ -265,7 +266,7 @@ function date_repeat_rrule_description($rrule, $format = 'D M d Y') {
         array(
           '!repeats_every_interval ' => '',
           '!date_order' => $order,
-          '!day_of_week' => $days[$day]
+          '!day_of_week' => $days[$day],
         )));
       }
       else {
@@ -287,14 +288,14 @@ function date_repeat_rrule_description($rrule, $format = 'D M d Y') {
         array(
           '!repeats_every_interval ' => '',
           '!month_days' => implode(', ', $rrule['BYMONTHDAY']),
-          '!month_names' => implode(', ', $results)
+          '!month_names' => implode(', ', $results),
         )));
       }
       else {
         $description['!bymonth'] = trim(t('!repeats_every_interval on !month_names',
         array(
           '!repeats_every_interval ' => '',
-          '!month_names' => implode(', ', $results)
+          '!month_names' => implode(', ', $results),
         )));
       }
     }
@@ -312,7 +313,7 @@ function date_repeat_rrule_description($rrule, $format = 'D M d Y') {
     $description['!until'] = trim(t('!repeats_every_interval until !until_date',
     array(
       '!repeats_every_interval ' => '',
-      '!until_date' => date_format_date($until, 'custom', $format)
+      '!until_date' => date_format_date($until, 'custom', $format),
     )));
   }
   if ($exceptions) {
@@ -325,7 +326,7 @@ function date_repeat_rrule_description($rrule, $format = 'D M d Y') {
     $description['!except'] = trim(t('!repeats_every_interval except !except_dates',
     array(
       '!repeats_every_interval ' => '',
-      '!except_dates' => implode(', ', $values)
+      '!except_dates' => implode(', ', $values),
     )));
   }
   if (!empty($rrule['WKST'])) {
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 d840df62..5b1afe2a 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
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Code to compute the dates that match an iCal RRULE.
@@ -53,11 +54,10 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
   // Create a date object for the start and end dates.
   $start_date = new DateObject($start, $timezone);
 
-  // Versions of PHP greater than PHP 5.3.5 require
-  // that we set an explicit time when using date_modify()
-  // or the time may not match the original value.
-  // Adding this modifier gives us the same results in both older
-  // and newer versions of PHP.
+  // Versions of PHP greater than PHP 5.3.5 require that we set an explicit
+  // time when using date_modify() or the time may not match the original value.
+  // Adding this modifier gives us the same results in both older and newer
+  // versions of PHP.
   $modify_time = ' ' . $start_date->format('g:ia');
 
   // If the rule has an UNTIL, see if that is earlier than the end date.
@@ -122,17 +122,16 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
   }
   $rrule = date_repeat_adjust_rrule($rrule, $start_date);
 
-  // The start date always goes into the results, whether or not it meets
-  // the rules. RFC 2445 includes examples where the start date DOES NOT
-  // meet the rules, but the expected results always include the start date.
+  // The start date always goes into the results, whether or not it meets the
+  // rules. RFC 2445 includes examples where the start date DOES NOT meet the
+  // rules, but the expected results always include the start date.
   $days = array(date_format($start_date, DATE_FORMAT_DATETIME));
 
   // BYMONTHDAY will look for specific days of the month in one or more months.
   // This process is only valid when frequency is monthly or yearly.
-
   if (!empty($rrule['BYMONTHDAY'])) {
     $finished = FALSE;
-    $current_day = clone($start_date);
+    $current_day = clone $start_date;
     $direction_days = array();
     // Deconstruct the day in case it has a negative modifier.
     foreach ($rrule['BYMONTHDAY'] as $day) {
@@ -187,13 +186,12 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
     }
   }
 
-  // This is the simple fallback case, not looking for any BYDAY,
-  // just repeating the start date. Because of imputed BYDAY above, this
-  // will only test TRUE for a DAILY or less frequency (like HOURLY).
-
+  // This is the simple fallback case, not looking for any BYDAY, just
+  // repeating the start date. Because of imputed BYDAY above, this will only
+  // test TRUE for a DAILY or less frequency (like HOURLY).
   elseif (empty($rrule['BYDAY'])) {
     // $current_day will keep track of where we are in the calculation.
-    $current_day = clone($start_date);
+    $current_day = clone $start_date;
     $finished = FALSE;
     $months = !empty($rrule['BYMONTH']) ? $rrule['BYMONTH'] : array();
     while (!$finished) {
@@ -204,17 +202,15 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
   }
 
   else {
-
-    // More complex searches for day names and criteria
-    // like '-1SU' or '2TU,2TH', require that we interate through
-    // the whole time period checking each BYDAY.
-
-    // Create helper array to pull day names out of iCal day strings.
+    // More complex searches for day names and criteria like '-1SU' or
+    // '2TU,2TH', require that we interate through the whole time period
+    // checking each BYDAY. Create helper array to pull day names out of iCal
+    // day strings.
     $day_names = date_repeat_dow_day_options(FALSE);
     $days_of_week = array_keys($day_names);
 
-    // Parse out information about the BYDAYs and separate them
-    // depending on whether they have directional parameters like -1SU or 2TH.
+    // Parse out information about the BYDAYs and separate them depending on
+    // whether they have directional parameters like -1SU or 2TH.
     $month_days = array();
     $week_days = array();
 
@@ -223,11 +219,11 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
     $week_start_rule = !empty($rrule['WKST']) ? trim($rrule['WKST']) : 'MO';
     $week_start_day = $day_names[$week_start_rule];
 
-    // Make sure the week days array is sorted into week order,
-    // we use the $ordered_keys to get the right values into the key
-    // and force the array to that order. Needed later when we
-    // iterate through each week looking for days so we don't
-    // jump to the next week when we hit a day out of order.
+    // Make sure the week days array is sorted into week order, we use the
+    // $ordered_keys to get the right values into the key and force the array
+    // to that order. Needed later when we iterate through each week looking
+    // for days so we don't jump to the next week when we hit a day out of
+    // order.
     $ordered = date_repeat_days_ordered($week_start_rule);
     $ordered_keys = array_flip($ordered);
 
@@ -236,8 +232,8 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
       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.
+          // 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]],
@@ -271,11 +267,11 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
     }
     ksort($week_days);
 
-    // BYDAYs with parameters like -1SU (last Sun) or 2TH (second Thur)
-    // need to be processed one month or year at a time.
+    // BYDAYs with parameters like -1SU (last Sun) or 2TH (second Thur) need to
+    // be processed one month or year at a time.
     if (!empty($direction_days) && in_array($rrule['FREQ'], array('MONTHLY', 'YEARLY'))) {
       $finished = FALSE;
-      $current_day = clone($start_date);
+      $current_day = clone $start_date;
       while (!$finished) {
         foreach ($direction_days as $day) {
           // Find the BYDAY date in the current month.
@@ -288,9 +284,9 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
           date_repeat_add_dates($days, $current_day, $start_date, $end_date, $exceptions, $rrule);
         }
         $finished = date_repeat_is_finished($current_day, $days, $count, $end_date);
-        // Reset to beginning of period before jumping to next period.
-        // Needed especially when working with values like 'last Saturday'
-        // to be sure we don't skip months like February.
+        // Reset to beginning of period before jumping to next period. Needed
+        // especially when working with values like 'last Saturday' to be sure
+        // we don't skip months like February.
         $year = date_format($current_day, 'Y');
         $month = date_format($current_day, 'n');
         if ($rrule['FREQ'] == 'MONTHLY') {
@@ -304,24 +300,22 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
       }
     }
 
-    // For BYDAYs without parameters,like TU,TH (every Tues and Thur),
-    // we look for every one of those days during the frequency period.
-    // Iterate through periods of a WEEK, MONTH, or YEAR, checking for
-    // the days of the week that match our criteria for each week in the
-    // period, then jumping ahead to the next week, month, or year,
-    // an INTERVAL at a time.
-
+    // For BYDAYs without parameters,like TU,TH (every Tues and Thur), we look
+    // for every one of those days during the frequency period. Iterate through
+    // periods of a WEEK, MONTH, or YEAR, checking for the days of the week
+    // that match our criteria for each week in the period, then jumping ahead
+    // to the next week, month, or year, an INTERVAL at a time.
     if (!empty($week_days) &&
       in_array($rrule['FREQ'], array('MONTHLY', 'WEEKLY', 'YEARLY'))) {
       $finished = FALSE;
-      $current_day = clone($start_date);
+      $current_day = clone $start_date;
       $format = $rrule['FREQ'] == 'YEARLY' ? 'Y' : 'n';
       $current_period = date_format($current_day, $format);
 
       // Back up to the beginning of the week in case we are somewhere in the
-      // middle of the possible week days, needed so we don't prematurely
-      // jump to the next week. The date_repeat_add_dates() function will
-      // keep dates outside the range from getting added.
+      // middle of the possible week days, needed so we don't prematurely jump
+      // to the next week. The date_repeat_add_dates() function will keep dates
+      // outside the range from getting added.
       if (date_format($current_day, 'l') != $day_names[$day]) {
         date_modify($current_day, '-1 ' . $week_start_day . $modify_time);
       }
@@ -330,15 +324,13 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
         while (!$period_finished) {
           $moved = FALSE;
           foreach ($week_days as $delta => $day) {
-            // Find the next occurence of each day in this week, only add it
-            // if we are still in the current month or year.
-            // The date_repeat_add_dates function is insufficient
-            // to test whether to include this date
-            // if we are using a rule like 'every other month', so we must
-            // explicitly test it here.
-
-            // If we're already on the right day, don't jump or we
-            // will prematurely move into the next week.
+            // Find the next occurence of each day in this week, only add it if
+            // we are still in the current month or year. The
+            // date_repeat_add_dates() function is insufficient to test whether
+            // to include this date if we are using a rule like 'every other
+            // month', so we must explicitly test it here. If we're already on
+            // the right day, don't jump or we will prematurely move into the
+            // next week.
             if (date_format($current_day, 'l') != $day) {
               date_modify($current_day, '+1 ' . $day . $modify_time);
               $moved = TRUE;
@@ -349,15 +341,15 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
           }
           $finished = date_repeat_is_finished($current_day, $days, $count, $end_date);
 
-          // Make sure we don't get stuck in endless loop if the current
-          // day never got changed above.
+          // Make sure we don't get stuck in endless loop if the current day
+          // never got changed above.
           if (!$moved) {
             date_modify($current_day, '+1 day' . $modify_time);
           }
 
-          // If this is a WEEKLY frequency, stop after each week,
-          // otherwise, stop when we've moved outside the current period.
-          // Jump to the end of the week, then test the period.
+          // If this is a WEEKLY frequency, stop after each week, otherwise,
+          // stop when we've moved outside the current period. Jump to the end
+          // of the week, then test the period.
           if ($finished || $rrule['FREQ'] == 'WEEKLY') {
             $period_finished = TRUE;
           }
@@ -370,11 +362,9 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
           continue;
         }
 
-        // We'll be at the end of a week, month, or year when
-        // we get to this point in the code.
-
-        // Go back to the beginning of this period before we jump, to
-        // ensure we jump to the first day of the next period.
+        // We'll be at the end of a week, month, or year when we get to this
+        // point in the code. Go back to the beginning of this period before we
+        // jump, to ensure we jump to the first day of the next period.
         switch ($rrule['FREQ']) {
           case 'WEEKLY':
             date_modify($current_day, '+1 ' . $week_start_day . $modify_time);
@@ -420,7 +410,6 @@ function date_repeat_adjust_rrule($rrule, $start_date) {
 
   // RFC 2445 says if no day or monthday is specified when creating repeats for
   // weeks, months, or years, impute the value from the start date.
-
   if (empty($rrule['BYDAY']) && $rrule['FREQ'] == 'WEEKLY') {
     $rrule['BYDAY'] = array(date_repeat_dow2day(date_format($start_date, 'w')));
   }
@@ -433,10 +422,9 @@ function date_repeat_adjust_rrule($rrule, $start_date) {
       $rrule['BYMONTH'] = array(date_format($start_date, 'n'));
     }
   }
-  // If we are processing rules for period other than YEARLY or MONTHLY
-  // and have BYDAYS like 2SU or -1SA, simplify them to SU or SA since the
-  // position rules make no sense in other periods and just add complexity.
-
+  // If we are processing rules for period other than YEARLY or MONTHLY and have
+  // BYDAYS like 2SU or -1SA, simplify them to SU or SA since the position
+  // rules make no sense in other periods and just add complexity.
   elseif (!empty($rrule['BYDAY']) && !in_array($rrule['FREQ'], array('MONTHLY', 'YEARLY'))) {
     foreach ($rrule['BYDAY'] as $delta => $by_day) {
       $rrule['BYDAY'][$delta] = substr($by_day, -2);
@@ -449,9 +437,9 @@ function date_repeat_adjust_rrule($rrule, $start_date) {
 /**
  * Helper function to add found date to the $dates array.
  *
- * Check that the date to be added is between the start and end date
- * and that it is not in the $exceptions, nor already in the $days array,
- * and that it meets other criteria in the RRULE.
+ * Check that the date to be added is between the start and end date and that it
+ * is not in the $exceptions, nor already in the $days array, and that it meets
+ * other criteria in the RRULE.
  */
 function date_repeat_add_dates(&$days, $current_day, $start_date, $end_date, $exceptions, $rrule) {
   if (isset($rrule['COUNT']) && count($days) >= $rrule['COUNT']) {
@@ -525,20 +513,18 @@ function date_repeat_is_finished($current_day, $days, $count, $end_date) {
  * Set a date object to a specific day of the month.
  *
  * Example,
- *   date_set_month_day($date, 'Sunday', 2, '-')
- *   will reset $date to the second to last Sunday in the month.
- *   If $day is empty, will set to the number of days from the
- *   beginning or end of the month.
+ *   date_set_month_day($date, 'Sunday', 2, '-') will reset $date to the second
+ *   to last Sunday in the month. If $day is empty, will set to the number of
+ *   days from the beginning or end of the month.
  */
 function date_repeat_set_month_day($date_in, $day, $count = 1, $direction = '+', $timezone = 'UTC', $modify_time = '') {
   if (is_object($date_in)) {
     $current_month = date_format($date_in, 'n');
 
-    // Reset to the start of the month.
-    // We should be able to do this with date_date_set(), but
-    // for some reason the date occasionally gets confused if run
-    // through this function multiple times. It seems to work
-    // reliably if we create a new object each time.
+    // Reset to the start of the month. We should be able to do this with
+    // date_date_set(), but for some reason the date occasionally gets confused
+    // if run through this function multiple times. It seems to work reliably
+    // if we create a new object each time.
     $datetime = date_format($date_in, DATE_FORMAT_DATETIME);
     $datetime = substr_replace($datetime, '01', 8, 2);
     $date = new DateObject($datetime, $timezone);
@@ -547,8 +533,8 @@ function date_repeat_set_month_day($date_in, $day, $count = 1, $direction = '+',
       date_modify($date, '+1 month' . $modify_time);
     }
     else {
-      // For positive search, back up one day to get outside the
-      // current month, so we can catch the first of the month.
+      // For positive search, back up one day to get outside the current month,
+      // so we can catch the first of the month.
       date_modify($date, '-1 day' . $modify_time);
     }
 
@@ -556,8 +542,8 @@ function date_repeat_set_month_day($date_in, $day, $count = 1, $direction = '+',
       date_modify($date, $direction . $count . ' days' . $modify_time);
     }
     else {
-      // Use the English text for order, like First Sunday
-      // instead of +1 Sunday to overcome PHP5 bug, (see #369020).
+      // Use the English text for order, like First Sunday instead of +1 Sunday
+      // to overcome PHP5 bug, (see #369020).
       $order = date_order();
       $step = $count <= 5 ? $order[$direction . $count] : $count;
       date_modify($date, $step . ' ' . $day . $modify_time);
@@ -575,17 +561,15 @@ function date_repeat_set_month_day($date_in, $day, $count = 1, $direction = '+',
  * Set a date object to a specific day of the year.
  *
  * Example,
- *   date_set_year_day($date, 'Sunday', 2, '-')
- *   will reset $date to the second to last Sunday in the year.
- *   If $day is empty, will set to the number of days from the
- *   beginning or end of the year.
+ *   date_set_year_day($date, 'Sunday', 2, '-') will reset $date to the second
+ *   to last Sunday in the year. 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, $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.
+    // Reset to the start of the month. See note above.
     $datetime = date_format($date_in, DATE_FORMAT_DATETIME);
     $month_key = isset($month) ? $month : '01';
     $datetime = substr_replace($datetime, $month_key . '-01', 5, 5);
@@ -597,8 +581,8 @@ function date_repeat_set_year_day($date_in, $month, $day, $count = 1, $direction
         $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.
+        // 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';
       }
     }
@@ -608,8 +592,8 @@ function date_repeat_set_year_day($date_in, $month, $day, $count = 1, $direction
         $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.
+        // 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';
       }
     }
@@ -620,8 +604,8 @@ function date_repeat_set_year_day($date_in, $month, $day, $count = 1, $direction
       date_modify($date, $direction . $count . ' days' . $modify_time);
     }
     else {
-      // Use the English text for order, like First Sunday
-      // instead of +1 Sunday to overcome PHP5 bug, (see #369020).
+      // Use the English text for order, like First Sunday instead of +1 Sunday
+      // to overcome PHP5 bug, (see #369020).
       $order = date_order();
       $step = $count <= 5 ? $order[$direction . $count] : $count;
       date_modify($date, $step . ' ' . $day . $modify_time);
diff --git a/drupal7/sites/all/modules/date/date_repeat/date_repeat_form.inc b/drupal7/sites/all/modules/date/date_repeat/date_repeat_form.inc
index 33525956..421200da 100644
--- a/drupal7/sites/all/modules/date/date_repeat/date_repeat_form.inc
+++ b/drupal7/sites/all/modules/date/date_repeat/date_repeat_form.inc
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Code to add a date repeat selection form to a date field and create
@@ -35,13 +36,10 @@
  * Generate the repeat setting form.
  */
 function _date_repeat_rrule_process($element, &$form_state, $form) {
-
-  // If the RRULE field is not visible to the user,
-  // needs no processing or validation.
-  // The Date field module is not adding this element to forms
-  // if the field is hidden,
-  // this test is just in case some other module attempts to do so.
-
+  // If the RRULE field is not visible to the user, needs no processing or
+  // validation. The Date field module is not adding this element to forms if
+  // the field is hidden, this test is just in case some other module attempts
+  // to do so.
   if (date_hidden_element($element)) {
     return $element;
   }
@@ -58,8 +56,8 @@ function _date_repeat_rrule_process($element, &$form_state, $form) {
     $rrule = $element['#default_value'];
   }
 
-  // Empty the original string value of the RRULE so we can create
-  // an array of values for the form from the RRULE's contents.
+  // Empty the original string value of the RRULE so we can create an array of
+  // values for the form from the RRULE's contents.
   $element['#value'] = '';
 
   $parts = date_repeat_split_rrule($rrule);
@@ -554,8 +552,8 @@ function _date_repeat_rrule_process($element, &$form_state, $form) {
   $parents = $element['#array_parents'];
   $instance = implode('-', $parents);
 
-  // Make sure this will work right either in the normal
-  // form or in an ajax callback from the 'Add more' button.
+  // Make sure this will work right either in the normal form or in an AJAX
+  // callback from the 'Add more' button.
   if (empty($form_state['num_exceptions'][$instance])) {
     $form_state['num_exceptions'][$instance] = count($exceptions);
   }
@@ -875,9 +873,6 @@ function date_repeat_merge($form_values, $element) {
           }
         }
         break;
-
-      default:
-        break;
     }
   }
 
@@ -967,7 +962,6 @@ function date_repeat_merge($form_values, $element) {
  * Build a RRULE out of the form values.
  */
 function date_repeat_rrule_validate($element, &$form_state) {
-
   if (date_hidden_element($element)) {
     return;
   }
@@ -980,9 +974,9 @@ function date_repeat_rrule_validate($element, &$form_state) {
     return;
   }
 
-  // Clean the buttons off of the form. Needed to avoid errors when
-  // the date is used on a user object, which then passes the form
-  // through form_state_values_clean().
+  // Clean the buttons off of the form. Needed to avoid errors when the date is
+  // used on a user object, which then passes the form through
+  // form_state_values_clean().
   foreach ($form_state['buttons'] as $delta => $item) {
     if (!empty($item['#ajax']['callback']) && in_array($item['#ajax']['callback'], array('date_repeat_add_exception_callback', 'date_repeat_add_addition_callback'))) {
       unset($form_state['buttons'][$delta]);
@@ -1070,8 +1064,8 @@ function date_repeat_filter_non_zero_value($value) {
 /**
  * Helper function for transforming the return value of checkbox(es) element.
  *
- * Can be used for transforming the returned value of checkbox(es) element
- * to the format of returned value of multiple select element.
+ * Can be used for transforming the returned value of checkbox(es) element to
+ * the format of returned value of multiple select element.
  */
 function date_repeat_transform_checkbox_values_to_select_values($values) {
   return array_filter($values, 'date_repeat_filter_non_zero_value');
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 fc4e5c3c..83a5fa5b 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
@@ -4,7 +4,9 @@
  * @file
  * Test Date Repeat calculations.
  */
-
+/**
+ *
+ */
 class DateRepeatTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
@@ -17,17 +19,19 @@ class DateRepeatTestCase extends DrupalWebTestCase {
   /**
    * Implements setUp().
    */
-  public function setUp() {
+  public function setUp(array $modules = array()) {
     // Load the date_repeat module.
-    parent::setUp('date_api', 'date_repeat');
+    $modules[] = 'date_api';
+    $modules[] = 'date_repeat';
+    parent::setUp($modules);
   }
 
   public function testDateRepeat() {
-    require_once('./' . drupal_get_path('module', 'date_api') . '/date_api_ical.inc');
-    require_once('./' . drupal_get_path('module', 'date_repeat') . '/date_repeat_calc.inc');
+    require_once './' . drupal_get_path('module', 'date_api') . '/date_api_ical.inc';
+    require_once './' . drupal_get_path('module', 'date_repeat') . '/date_repeat_calc.inc';
+
     // Examples adapted from http://www.faqs.org/rfcs/rfc2445.html and
     // http://www.kanzaki.com/docs/ical/rrule.html.
-
     //  Invalid value:
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
@@ -48,7 +52,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Daily until September 24, 1997:
+    // Daily until September 24, 1997:
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=DAILY;UNTIL=19970924T000000Z";
@@ -58,7 +62,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every other day - until September 30:
+    // Every other day - until September 30:
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=DAILY;INTERVAL=2";
@@ -68,7 +72,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every 10 days, 2 occurrences:
+    // Every 10 days, 2 occurrences:
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=DAILY;INTERVAL=10;COUNT=2";
@@ -78,7 +82,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Weekly for 3 occurrences
+    // Weekly for 3 occurrences.
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=WEEKLY;COUNT=3";
@@ -88,7 +92,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Weekly until September 24, 1997
+    // Weekly until September 24, 1997
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=WEEKLY;UNTIL=19970924T000000Z";
@@ -98,7 +102,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every other week - forever:
+    // Every other week - forever:
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=WEEKLY;INTERVAL=2;WKST=SU";
@@ -108,7 +112,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Weekly on Tuesday and Thursday for 4 weeks:
+    // Weekly on Tuesday and Thursday for 4 weeks:
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=WEEKLY;COUNT=8;WKST=SU;BYDAY=TU,TH";
@@ -118,7 +122,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every other week on Tuesday and Thursday, for 5 occurrences:
+    // Every other week on Tuesday and Thursday, for 5 occurrences:
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=5;WKST=SU;BYDAY=TU,TH";
@@ -128,7 +132,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every other week on Monday, Wednesday and Friday until September 24, 1997,
+    // Every other week on Monday, Wednesday and Friday until September 24, 1997,
     $start = "1997-09-02 09:00:00";
     $end = "1997-09-30 09:00:00";
     $rule = "RRULE:FREQ=WEEKLY;INTERVAL=2;UNTIL=19970924T000000Z;WKST=SU;BYDAY=MO,WE,FR";
@@ -138,7 +142,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Monthly on the 1st Friday for 2 occurrences:
+    // Monthly on the 1st Friday for 2 occurrences:
     $start = "1997-09-05 09:00:00";
     $end = "1997-10-31 09:00:00";
     $rule = "RRULE:FREQ=MONTHLY;COUNT=2;BYDAY=1FR";
@@ -148,7 +152,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Monthly on the 1st Friday until December 24, 1997:
+    // Monthly on the 1st Friday until December 24, 1997:
     $start = "1997-09-05 09:00:00";
     $end = "1998-10-01 09:00:00";
     $rule = "RRULE:FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR";
@@ -157,7 +161,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every other month on the 1st and last Sunday of the month for 10 occurrences:
+    // Every other month on the 1st and last Sunday of the month for 10 occurrences:
     $start = "1997-09-07 09:00:00";
     $end = "1998-10-01 09:00:00";
     $rule = "RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU";
@@ -170,11 +174,11 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Monthly on the second to last Monday of the month for 6 months:
+    // Monthly on the second to last Monday of the month for 6 months:
     $start = "1997-09-22 09:00:00";
     $end = "1998-10-01 09:00:00";
     $rule = "RRULE:FREQ=MONTHLY;COUNT=6;BYDAY=-2MO";
-    //==> (1997 9:00 AM EDT)September 22;October 20
+    // ==> (1997 9:00 AM EDT)September 22;October 20
     //  (1997 9:00 AM EST)November 17;December 22
     //  (1998 9:00 AM EST)January 19;February 16
     $dates = date_repeat_calc($rule, $start, $end, array());
@@ -182,7 +186,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every Tuesday, every other month:
+    // Every Tuesday, every other month:
     $start = "1997-09-02 09:00:00";
     $end = "1998-02-01 09:00:00";
     $rule = "RRULE:FREQ=MONTHLY;INTERVAL=2;BYDAY=TU";
@@ -194,7 +198,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Yearly in June and July for 10 occurrences:
+    // Yearly in June and July for 10 occurrences:
     $start = "1997-06-10 09:00:00";
     $end = "2002-01-01 09:00:00";
     $rule = "RRULE:FREQ=YEARLY;COUNT=10;BYMONTH=6,7";
@@ -204,13 +208,13 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     //      (2000 9:00 AM EDT)June 10;July 10
     //      (2001 9:00 AM EDT)June 10;July 10
     //  Note: Since none of the BYDAY, BYMONTHDAY or BYYEARDAY components
-    //  are specified, the day is gotten from DTSTART
+    //  are specified, the day is gotten from DTSTART.
     $dates = date_repeat_calc($rule, $start, $end, array());
     $shouldbe = '1997-06-10 09:00:00, 1997-07-10 09:00:00, 1998-06-10 09:00:00, 1998-07-10 09:00:00, 1999-06-10 09:00:00, 1999-07-10 09:00:00, 2000-06-10 09:00:00, 2000-07-10 09:00:00, 2001-06-10 09:00:00, 2001-07-10 09:00:00';
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every other year on January, February, and March for 10 occurrences:
+    // Every other year on January, February, and March for 10 occurrences:
     $start = "1997-03-10 09:00:00";
     $end = "2004-01-01 09:00:00";
     $rule = "RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3";
@@ -223,7 +227,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //An example where the days generated makes a difference because of WKST:
+    // An example where the days generated makes a difference because of WKST:
     $start = "1997-08-05 09:00:00";
     $end = "2004-01-01 09:00:00";
     $rule = "RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO";
@@ -233,7 +237,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //changing only WKST from MO to SU, yields different results...
+    // changing only WKST from MO to SU, yields different results...
     $start = "1997-08-05 09:00:00";
     $end = "2004-01-01 09:00:00";
     $rule = "RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU";
@@ -243,7 +247,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every 18 months on the 10th thru 15th of the month for 10 occurrences:
+    // Every 18 months on the 10th thru 15th of the month for 10 occurrences:
     $start = "1997-09-10 09:00:00";
     $end = "2004-01-01 09:00:00";
     $rule = "RRULE:FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,15";
@@ -254,7 +258,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Monthly on the third to the last day of the month, forever:
+    // Monthly on the third to the last day of the month, forever:
     $start = "1997-09-28 09:00:00";
     $end = "1998-03-01 09:00:00";
     $rule = "RRULE:FREQ=MONTHLY;BYMONTHDAY=-3";
@@ -266,7 +270,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every Thursday in March, forever:
+    // Every Thursday in March, forever:
     //  ==> (1997 9:00 AM EST)March 13,20,27
     //      (1998 9:00 AM EST)March 5,12,19,26
     //      (1999 9:00 AM EST)March 4,11,18,25
@@ -278,7 +282,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every Thursday, but only during June, July, and August, forever:
+    // Every Thursday, but only during June, July, and August, forever:
     //  ==> (1997 9:00 AM EDT)June 5,12,19,26;July 3,10,17,24,31;August 7,14,21,28
     //      (1998 9:00 AM EDT)June 4,11,18,25;July 2,9,16,23,30;August 6,13,20,27
     //      (1999 9:00 AM EDT)June 3,10,17,24;July 1,8,15,22,29;August 5,12,19,26
@@ -290,7 +294,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Monthly on the 2nd and 15th of the month for 10 occurrences:
+    // Monthly on the 2nd and 15th of the month for 10 occurrences:
     //  ==> (1997 9:00 AM EDT)September 2,15;October 2,15
     //      (1997 9:00 AM EST)November 2,15;December 2,15
     //      (1998 9:00 AM EST)January 2,15
@@ -302,7 +306,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Monthly on the first and last day of the month for 10 occurrences:
+    // Monthly on the first and last day of the month for 10 occurrences:
     //  ==> (1997 9:00 AM EDT)September 30;October 1
     //      (1997 9:00 AM EST)October 31;November 1,30;December 1,31
     //      (1998 9:00 AM EST)January 1,31;February 1
@@ -314,7 +318,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every Friday the 13th, forever:
+    // Every Friday the 13th, forever:
     $rule = "EXDATE;TZID=US-Eastern:19970902T090000";
     //  ==> (1998 9:00 AM EST)February 13;March 13;November 13
     //      (1999 9:00 AM EDT)August 13
@@ -327,7 +331,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //The first Saturday that follows the first Sunday of the month, forever:
+    // The first Saturday that follows the first Sunday of the month, forever:
     //  ==> (1997 9:00 AM EDT)September 13;October 11
     //      (1997 9:00 AM EST)November 8;December 13
     //      (1998 9:00 AM EST)January 10;February 7;March 7
@@ -340,8 +344,8 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every four years, the first Tuesday after a Monday in November,
-    //forever (U.S. Presidential Election day):
+    // Every four years, the first Tuesday after a Monday in November,
+    // forever (U.S. Presidential Election day):
     //  ==> (1996 9:00 AM EST)November 5
     //      (2000 9:00 AM EST)November 7
     //      (2004 9:00 AM EST)November 2
@@ -353,7 +357,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every 20th Monday of the year, forever:
+    // Every 20th Monday of the year, forever:
     $start = "1997-05-19 09:00:00";
     $end = "2000-01-01 09:00:00";
     $rule = "RRULE:FREQ=YEARLY;BYDAY=20MO";
@@ -365,7 +369,7 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-    //Every Sunday in January, every other year, forever:
+    // Every Sunday in January, every other year, forever:
     $start = "1997-01-05 09:00:00";
     $end = "2001-02-01 09:00:00";
     $rule = 'RRULE:FREQ=YEARLY;INTERVAL=2;BYMONTH=1;BYDAY=SU';
@@ -377,7 +381,7 @@ 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:
+    // 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
@@ -390,9 +394,9 @@ class DateRepeatTestCase extends DrupalWebTestCase {
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-return;
+    return;
 
-    //Every Thanksgiving, forever:
+    // Every Thanksgiving, forever:
     $start = "1997-01-01 09:00:00";
     $end = "2001-02-01 09:00:00";
     $rule = 'RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYDAY=4TH';
@@ -404,65 +408,57 @@ return;
     $result = implode(', ', $dates);
     $this->assertEqual($result, $shouldbe, $rule . '; Starting ' . $start . ';  results: ' . $result);
 
-// TODO:
-// BYYEARDAY, BYSETPOS,
-// BYHOUR, BYMINUTE, HOURLY, MINUTELY, SECONDLY
-// have not yet been implemented in date_repeat.
-
-//Every 3rd year on the 1st, 100th and 200th day for 10 occurrences:
-$date = "DTSTART;TZID=US-Eastern:19970101T090000";
-$rule = "RRULE:FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200";
-//  ==> (1997 9:00 AM EST)January 1
-//      (1997 9:00 AM EDT)April 10;July 19
-//      (2000 9:00 AM EST)January 1
-//      (2000 9:00 AM EDT)April 9;July 18
-//      (2003 9:00 AM EST)January 1
-//      (2003 9:00 AM EDT)April 10;July 19
-//      (2006 9:00 AM EST)January 1
-
-//Monday of week number 20 (where the default start of the week is Monday), forever:
-$date = "DTSTART;TZID=US-Eastern:19970512T090000";
-$rule = "RRULE:FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO";
-//  ==> (1997 9:00 AM EDT)May 12
-//      (1998 9:00 AM EDT)May 11
-//      (1999 9:00 AM EDT)May 17
-
-//The 3rd instance into the month of one of Tuesday, Wednesday or
-//Thursday, for the next 3 months:
-$date = "DTSTART;TZID=US-Eastern:19970904T090000";
-$rule = "RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3";
-//  ==> (1997 9:00 AM EDT)September 4;October 7
-//      (1997 9:00 AM EST)November 6
-
-//The 2nd to last weekday of the month:
-$date = "DTSTART;TZID=US-Eastern:19970929T090000";
-$rule = "RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2";
-//  ==> (1997 9:00 AM EDT)September 29
-//      (1997 9:00 AM EST)October 30;November 27;December 30
-//      (1998 9:00 AM EST)January 29;February 26;March 30
-
-//Every 3 hours from 9:00 AM to 5:00 PM on a specific day:
-$date = "DTSTART;TZID=US-Eastern:19970902T090000";
-$rule = "RRULE:FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z";
-//  ==> (September 2, 1997 EDT)09:00,12:00,15:00
-
-//Every 15 minutes for 6 occurrences:
-$date = "DTSTART;TZID=US-Eastern:19970902T090000";
-$rule = "RRULE:FREQ=MINUTELY;INTERVAL=15;COUNT=6";
-//  ==> (September 2, 1997 EDT)09:00,09:15,09:30,09:45,10:00,10:15
-
-//Every hour and a half for 4 occurrences:
-$date = "DTSTART;TZID=US-Eastern:19970902T090000";
-$rule = "RRULE:FREQ=MINUTELY;INTERVAL=90;COUNT=4";
-//  ==> (September 2, 1997 EDT)09:00,10:30;12:00;13:30
-
-//Every 20 minutes from 9:00 AM to 4:40 PM every day:
-$date = "DTSTART;TZID=US-Eastern:19970902T090000";
-$rule = "RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40";
-//  or
-$rule = "RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16";
-//  ==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,16:00,16:20,16:40
-//      (September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,16:00,16:20,16:40
-
+    // TODO:
+    // BYYEARDAY, BYSETPOS,
+    // BYHOUR, BYMINUTE, HOURLY, MINUTELY, SECONDLY
+    // have not yet been implemented in date_repeat.
+    // Every 3rd year on the 1st, 100th and 200th day for 10 occurrences:
+    $date = "DTSTART;TZID=US-Eastern:19970101T090000";
+    $rule = "RRULE:FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200";
+    //  ==> (1997 9:00 AM EST)January 1
+    //      (1997 9:00 AM EDT)April 10;July 19
+    //      (2000 9:00 AM EST)January 1
+    //      (2000 9:00 AM EDT)April 9;July 18
+    //      (2003 9:00 AM EST)January 1
+    //      (2003 9:00 AM EDT)April 10;July 19
+    //      (2006 9:00 AM EST)January 1
+    // Monday of week number 20 (where the default start of the week is Monday), forever:
+    $date = "DTSTART;TZID=US-Eastern:19970512T090000";
+    $rule = "RRULE:FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO";
+    //  ==> (1997 9:00 AM EDT)May 12
+    //      (1998 9:00 AM EDT)May 11
+    //      (1999 9:00 AM EDT)May 17
+    // The 3rd instance into the month of one of Tuesday, Wednesday or
+    // Thursday, for the next 3 months:
+    $date = "DTSTART;TZID=US-Eastern:19970904T090000";
+    $rule = "RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3";
+    //  ==> (1997 9:00 AM EDT)September 4;October 7
+    //      (1997 9:00 AM EST)November 6
+    // The 2nd to last weekday of the month:
+    $date = "DTSTART;TZID=US-Eastern:19970929T090000";
+    $rule = "RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2";
+    //  ==> (1997 9:00 AM EDT)September 29
+    //      (1997 9:00 AM EST)October 30;November 27;December 30
+    //      (1998 9:00 AM EST)January 29;February 26;March 30
+    // Every 3 hours from 9:00 AM to 5:00 PM on a specific day:
+    $date = "DTSTART;TZID=US-Eastern:19970902T090000";
+    $rule = "RRULE:FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z";
+    //  ==> (September 2, 1997 EDT)09:00,12:00,15:00
+    // Every 15 minutes for 6 occurrences:
+    $date = "DTSTART;TZID=US-Eastern:19970902T090000";
+    $rule = "RRULE:FREQ=MINUTELY;INTERVAL=15;COUNT=6";
+    //  ==> (September 2, 1997 EDT)09:00,09:15,09:30,09:45,10:00,10:15
+    // Every hour and a half for 4 occurrences:
+    $date = "DTSTART;TZID=US-Eastern:19970902T090000";
+    $rule = "RRULE:FREQ=MINUTELY;INTERVAL=90;COUNT=4";
+    //  ==> (September 2, 1997 EDT)09:00,10:30;12:00;13:30
+    // Every 20 minutes from 9:00 AM to 4:40 PM every day:
+    $date = "DTSTART;TZID=US-Eastern:19970902T090000";
+    $rule = "RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40";
+    //  or.
+    $rule = "RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16";
+    //  ==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,16:00,16:20,16:40
+    //      (September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,16:00,16:20,16:40
   }
+
 }
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 22d65296..fc05c0ff 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
@@ -5,6 +5,9 @@
  * Test Date Repeat form.
  */
 
+/**
+ * Test Date Repeat form.
+ */
 class DateRepeatFormTestCase extends DrupalWebTestCase {
   protected $privileged_user;
 
@@ -17,21 +20,31 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
   }
 
   /**
-   * Implements setUp().
+   * {@inheritdoc}
    */
-  public function setUp() {
+  public function setUp(array $modules = array()) {
     // Load the date_repeat module.
-    parent::setUp('field', 'field_ui', 'date_api', 'date_repeat', 'date', 'date_popup', 'date_repeat_field');
+    $modules[] = 'field';
+    $modules[] = 'field_ui';
+    $modules[] = 'date_api';
+    $modules[] = 'date_repeat';
+    $modules[] = 'date';
+    $modules[] = 'date_popup';
+    $modules[] = 'date_repeat_field';
+    parent::setUp($modules);
 
     // Create and log in our privileged user.
     $this->privileged_user = $this->drupalCreateUser(array(
-      'administer content types', 'administer nodes', 'bypass node access', 'view date repeats', 'administer fields'
+      'administer content types', 'administer nodes', 'bypass node access', 'view date repeats', 'administer fields',
     ));
     $this->drupalLogin($this->privileged_user);
 
     variable_set('date_format_short', 'Y-m-d H:i');
   }
 
+  /**
+   * Test the Date Repeat form.
+   */
   public function testDateRepeatForm() {
     $edit = array();
     $edit['name'] = 'Date';
@@ -84,8 +97,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
       $form_edit = $this->dateForm($options, 'daily_1', FALSE, 'exclude_include');
       $this->verifyDateForm($form_edit);
 
-      // Weekly tests
-
+      // Weekly tests.
       $form_edit = $this->dateForm($options, 'weekly_1');
       $this->verifyDateForm($form_edit);
 
@@ -110,8 +122,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
       $form_edit = $this->dateForm($options, 'weekly_4', TRUE);
       $this->verifyDateForm($form_edit);
 
-      // Monthly tests
-
+      // Monthly tests.
       $form_edit = $this->dateForm($options, 'monthly_1');
       $this->verifyDateForm($form_edit);
 
@@ -148,8 +159,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
       $form_edit = $this->dateForm($options, 'monthly_6', TRUE);
       $this->verifyDateForm($form_edit);
 
-      // Yearly tests
-
+      // Yearly tests.
       $form_edit = $this->dateForm($options, 'yearly_1');
       $this->verifyDateForm($form_edit);
 
@@ -197,7 +207,6 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
     $edit['body[und][0][value]'] = $this->randomName(16);
     $current_year = date('Y');
 
-
     switch ($options) {
       case 'select':
         $edit['field_test[und][0][value][year]'] = $current_year;
@@ -206,59 +215,67 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
         $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]'] = format_string('!year-10-07 10:30', array('!year' => $current_year));
         break;
+
       case 'popup':
         $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;
     }
 
-    // Tests that Date repeat settings function properly
+    // Tests that Date repeat settings function properly.
     if ($test_id !== NULL) {
       $edit['field_test[und][0][show_repeat_settings]'] = TRUE;
       $count = 5;
 
       switch ($test_id) {
-        // Daily test cases
+        // Daily test cases.
         case 'daily_1':
           $edit['field_test[und][0][rrule][FREQ]'] = 'DAILY';
           $edit['field_test[und][0][rrule][daily][byday_radios]'] = 'INTERVAL';
           $edit['field_test[und][0][rrule][daily][INTERVAL_child]'] = 2;
           break;
+
         case 'daily_2':
           $edit['field_test[und][0][rrule][FREQ]'] = 'DAILY';
           $edit['field_test[und][0][rrule][daily][byday_radios]'] = 'every_weekday';
           break;
+
         case 'daily_3':
           $edit['field_test[und][0][rrule][FREQ]'] = 'DAILY';
           $edit['field_test[und][0][rrule][daily][byday_radios]'] = 'every_mo_we_fr';
           break;
+
         case 'daily_4':
           $edit['field_test[und][0][rrule][FREQ]'] = 'DAILY';
           $edit['field_test[und][0][rrule][daily][byday_radios]'] = 'every_tu_th';
           break;
 
-        // Weekly test cases
+        // Weekly test cases.
         case 'weekly_1':
           $edit['field_test[und][0][rrule][FREQ]'] = 'WEEKLY';
           $edit['field_test[und][0][rrule][weekly][BYDAY][MO]'] = TRUE;
           $edit['field_test[und][0][rrule][weekly][BYDAY][WE]'] = TRUE;
           $edit['field_test[und][0][rrule][weekly][BYDAY][TH]'] = TRUE;
           break;
+
         case 'weekly_2':
           $edit['field_test[und][0][rrule][FREQ]'] = 'WEEKLY';
           $edit['field_test[und][0][rrule][weekly][INTERVAL]'] = 1;
           $edit['field_test[und][0][rrule][weekly][BYDAY][MO]'] = TRUE;
           $edit['field_test[und][0][rrule][weekly][BYDAY][FR]'] = TRUE;
           break;
+
         case 'weekly_3':
           $edit['field_test[und][0][rrule][FREQ]'] = 'WEEKLY';
           $edit['field_test[und][0][rrule][weekly][INTERVAL]'] = 2;
           $edit['field_test[und][0][rrule][weekly][BYDAY][TU]'] = TRUE;
           $edit['field_test[und][0][rrule][weekly][BYDAY][TH]'] = TRUE;
           break;
+
         case 'weekly_4':
           $edit['field_test[und][0][rrule][FREQ]'] = 'WEEKLY';
           $edit['field_test[und][0][rrule][weekly][INTERVAL]'] = 10;
@@ -269,13 +286,14 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           $edit['field_test[und][0][rrule][weekly][BYDAY][FR]'] = TRUE;
           break;
 
-        // Monthly test cases
+        // Monthly test cases.
         case 'monthly_1':
           $edit['field_test[und][0][rrule][FREQ]'] = 'MONTHLY';
           $edit['field_test[und][0][rrule][monthly][day_month]'] = 'BYDAY_BYMONTH';
           $edit['field_test[und][0][rrule][monthly][BYDAY_BYMONTH_child][BYDAY_COUNT]'] = '+1';
           $edit['field_test[und][0][rrule][monthly][BYDAY_BYMONTH_child][BYDAY_DAY]'] = 'FR';
           break;
+
         case 'monthly_2':
           $edit['field_test[und][0][rrule][FREQ]'] = 'MONTHLY';
           $edit['field_test[und][0][rrule][monthly][day_month]'] = 'BYDAY_BYMONTH';
@@ -288,6 +306,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           $edit['field_test[und][0][rrule][monthly][BYDAY_BYMONTH_child][BYMONTH][9]'] = TRUE;
           $edit['field_test[und][0][rrule][monthly][BYDAY_BYMONTH_child][BYMONTH][11]'] = TRUE;
           break;
+
         case 'monthly_3':
           $edit['field_test[und][0][rrule][FREQ]'] = 'MONTHLY';
           $edit['field_test[und][0][rrule][monthly][day_month]'] = 'BYDAY_BYMONTH';
@@ -296,11 +315,13 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           $edit['field_test[und][0][rrule][monthly][BYDAY_BYMONTH_child][BYMONTH][6]'] = TRUE;
           $edit['field_test[und][0][rrule][monthly][BYDAY_BYMONTH_child][BYMONTH][12]'] = TRUE;
           break;
+
         case 'monthly_4':
           $edit['field_test[und][0][rrule][FREQ]'] = 'MONTHLY';
           $edit['field_test[und][0][rrule][monthly][day_month]'] = 'BYMONTHDAY_BYMONTH';
           $edit['field_test[und][0][rrule][monthly][BYMONTHDAY_BYMONTH_child][BYMONTHDAY]'] = '10';
           break;
+
         case 'monthly_5':
           $edit['field_test[und][0][rrule][FREQ]'] = 'MONTHLY';
           $edit['field_test[und][0][rrule][monthly][day_month]'] = 'BYMONTHDAY_BYMONTH';
@@ -309,6 +330,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           $edit['field_test[und][0][rrule][monthly][BYMONTHDAY_BYMONTH_child][BYMONTH][2]'] = TRUE;
           $edit['field_test[und][0][rrule][monthly][BYMONTHDAY_BYMONTH_child][BYMONTH][3]'] = TRUE;
           break;
+
         case 'monthly_6':
           $edit['field_test[und][0][rrule][FREQ]'] = 'MONTHLY';
           $edit['field_test[und][0][rrule][monthly][day_month]'] = 'BYMONTHDAY_BYMONTH';
@@ -318,13 +340,14 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           $edit['field_test[und][0][rrule][monthly][BYMONTHDAY_BYMONTH_child][BYMONTH][6]'] = TRUE;
           break;
 
-        // Yearly test cases
+        // Yearly test cases.
         case 'yearly_1':
           $edit['field_test[und][0][rrule][FREQ]'] = 'YEARLY';
           $edit['field_test[und][0][rrule][yearly][day_month]'] = 'BYDAY_BYMONTH';
           $edit['field_test[und][0][rrule][yearly][BYDAY_BYMONTH_child][BYDAY_COUNT]'] = '+1';
           $edit['field_test[und][0][rrule][yearly][BYDAY_BYMONTH_child][BYDAY_DAY]'] = 'FR';
           break;
+
         case 'yearly_2':
           $edit['field_test[und][0][rrule][FREQ]'] = 'YEARLY';
           $edit['field_test[und][0][rrule][yearly][INTERVAL]'] = 2;
@@ -338,6 +361,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           $edit['field_test[und][0][rrule][yearly][BYDAY_BYMONTH_child][BYMONTH][9]'] = TRUE;
           $edit['field_test[und][0][rrule][yearly][BYDAY_BYMONTH_child][BYMONTH][11]'] = TRUE;
           break;
+
         case 'yearly_3':
           $edit['field_test[und][0][rrule][FREQ]'] = 'YEARLY';
           $edit['field_test[und][0][rrule][yearly][INTERVAL]'] = 3;
@@ -347,11 +371,13 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           $edit['field_test[und][0][rrule][yearly][BYDAY_BYMONTH_child][BYMONTH][6]'] = TRUE;
           $edit['field_test[und][0][rrule][yearly][BYDAY_BYMONTH_child][BYMONTH][12]'] = TRUE;
           break;
+
         case 'yearly_4':
           $edit['field_test[und][0][rrule][FREQ]'] = 'YEARLY';
           $edit['field_test[und][0][rrule][yearly][day_month]'] = 'BYMONTHDAY_BYMONTH';
           $edit['field_test[und][0][rrule][yearly][BYMONTHDAY_BYMONTH_child][BYMONTHDAY]'] = '10';
           break;
+
         case 'yearly_5':
           $edit['field_test[und][0][rrule][FREQ]'] = 'YEARLY';
           $edit['field_test[und][0][rrule][yearly][INTERVAL]'] = 2;
@@ -361,6 +387,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           $edit['field_test[und][0][rrule][yearly][BYMONTHDAY_BYMONTH_child][BYMONTH][2]'] = TRUE;
           $edit['field_test[und][0][rrule][yearly][BYMONTHDAY_BYMONTH_child][BYMONTH][3]'] = TRUE;
           break;
+
         case 'yearly_6':
           $edit['field_test[und][0][rrule][FREQ]'] = 'YEARLY';
           $edit['field_test[und][0][rrule][yearly][INTERVAL]'] = 3;
@@ -372,7 +399,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
           break;
       }
 
-      // Test COUNT or UNTIL (default)
+      // Test COUNT or UNTIL (default).
       if ($is_count) {
         $edit['field_test[und][0][rrule][range_of_repeat]'] = 'COUNT';
         $edit['field_test[und][0][rrule][count_child]'] = $count;
@@ -382,12 +409,12 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
         $date = array(
           'year' => $current_year + 1,
           'month' => '10',
-          'day' => '07'
+          'day' => '07',
         );
         $edit += $this->formatDateForRRULEInputs('field_test[und][0][rrule][until_child]', $options, $date);
       }
 
-      // Test date exceptions and/or additions
+      // Test date exceptions and/or additions.
       if ($exclude_include !== NULL) {
         $exclude_include_edit = array();
         switch ($exclude_include) {
@@ -396,25 +423,27 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
             $date = array(
               'year' => $current_year,
               'month' => '10',
-              'day' => '07'
+              'day' => '07',
             );
             $exclude_include_edit += $this->formatDateForRRULEInputs('field_test[und][0][rrule][exceptions][EXDATE][0]', $options, $date);
             break;
+
           case 'include':
             $exclude_include_edit['field_test[und][0][rrule][show_additions]'] = TRUE;
             $date = array(
               'year' => $current_year + 3,
               'month' => '10',
-              'day' => '07'
+              'day' => '07',
             );
             $exclude_include_edit += $this->formatDateForRRULEInputs('field_test[und][0][rrule][additions][RDATE][0]', $options, $date);
             break;
+
           case 'exclude_include':
             $exclude_include_edit['field_test[und][0][rrule][show_exceptions]'] = TRUE;
             $date = array(
               'year' => $current_year,
               'month' => '10',
-              'day' => '07'
+              'day' => '07',
             );
             $exclude_include_edit += $this->formatDateForRRULEInputs('field_test[und][0][rrule][exceptions][EXDATE][0]', $options, $date);
 
@@ -422,7 +451,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
             $date = array(
               'year' => $current_year + 3,
               'month' => '10',
-              'day' => '07'
+              'day' => '07',
             );
             $exclude_include_edit += $this->formatDateForRRULEInputs('field_test[und][0][rrule][additions][RDATE][0]', $options, $date);
             break;
@@ -434,7 +463,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
     $this->drupalPost('node/add/date', $edit, t('Save'));
     $this->assertText($edit['body[und][0][value]'], 'Test node has been created');
 
-    // Return the settings for later use in verification
+    // Return the settings for later use in verification.
     return $edit;
   }
 
@@ -456,7 +485,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
     $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][weight]'] = '-100';
     $edit['fields[_add_new_field][type]'] = $type;
     $edit['fields[_add_new_field][widget_type]'] = $widget;
 
@@ -469,9 +498,9 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
     switch ($widget) {
       case 'select':
       case 'popup':
-      $instance_edit['instance[widget][settings][year_range][years_back]'] = '-5';
-      $instance_edit['instance[widget][settings][year_range][years_forward]'] = '+5';
-      break;
+        $instance_edit['instance[widget][settings][year_range][years_back]'] = '-5';
+        $instance_edit['instance[widget][settings][year_range][years_forward]'] = '+5';
+        break;
     }
 
     if ($display_all_day) {
@@ -510,6 +539,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
         $return["{$form_field_name}[datetime][month]"] = $date['month'];
         $return["{$form_field_name}[datetime][day]"] = ltrim($date['day'], '0');
         break;
+
       case 'text':
       case 'popup':
         $return["{$form_field_name}[datetime][date]"] = "{$date['year']}-{$date['month']}-{$date['day']}";
@@ -518,4 +548,5 @@ class DateRepeatFormTestCase extends DrupalWebTestCase {
 
     return $return;
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/date_repeat_field/README.txt b/drupal7/sites/all/modules/date/date_repeat_field/README.txt
index 3c7aab5c..e5fcd15f 100644
--- a/drupal7/sites/all/modules/date/date_repeat_field/README.txt
+++ b/drupal7/sites/all/modules/date/date_repeat_field/README.txt
@@ -1,4 +1,4 @@
 Date Repeat Field
-
-The functionality to integrate the Date Repeat API into date fields is being moved into this module,
-which can then be enabled or disabled, depending on whether repeating date fields are needed.
\ No newline at end of file
+-----------------
+Creates the option of repeating date fields and manages Date fields that use
+the Date Repeat API.
diff --git a/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.css b/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.css
index bb8926c0..5867bd5b 100644
--- a/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.css
+++ b/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.css
@@ -1,3 +1,8 @@
+/**
+ * @file
+ * Custom CSS for the Date Repeat Field module.
+ */
+
 .date-repeat-input {
   float: left; /* LTR */
   margin-right: 5px; /* LTR */
diff --git a/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.devel_generate.inc b/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.devel_generate.inc
index 51c3708b..a50d2554 100644
--- a/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.devel_generate.inc
+++ b/drupal7/sites/all/modules/date/date_repeat_field/date_repeat_field.devel_generate.inc
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Handling of devel generate functionality for repeating dates.
@@ -6,11 +7,9 @@
 
 /**
  * Implements hook_date_field_insert().
- *
- * A substitute for hook_devel_generate to handle repeating dates.
  */
 function date_repeat_field_date_field_insert(&$items, $context) {
-
+  // A substitute for hook_devel_generate to handle repeating dates.
   $entity_type = $context['entity_type'];
   $entity = $context['entity'];
   $field = $context['field'];
@@ -103,7 +102,6 @@ function date_repeat_field_date_field_insert(&$items, $context) {
       $freq = $options[$freq];
       $form_values['FREQ'] = $freq;
       $form_values['BYDAY'] = array($dow);
-      break;
   }
 
   $form_values['INTERVAL'] = $interval;
@@ -123,7 +121,6 @@ function date_repeat_field_date_field_insert(&$items, $context) {
 
     default:
       $period = 'day';
-      break;
   }
 
   $form_values['UNTIL'] = array();
@@ -135,11 +132,13 @@ function date_repeat_field_date_field_insert(&$items, $context) {
   $values = date_repeat_build_dates($field, $item, $rrule, $form_values);
 
   $items += $values;
-
 }
 
 /**
  * Generate a random content keys.
+ *
+ * @return string
+ *   A random string generated by mt_rand().
  */
 function date_content_generate_key($array) {
   $keys = array_keys($array);
@@ -151,8 +150,9 @@ function date_content_generate_key($array) {
 /**
  * Helper function for BYDAY options.
  *
- * Creates options like -1SU and 2TU
- * Omit options that won't find many matches, like 5th Sunday.
+ * @return array
+ *   Creates options like -1SU and 2TU. Omits options that won't find many
+ *   matches, like 5th Sunday.
  */
 function date_content_repeat_dow_options() {
   $options = array();
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 c9aa9d67..69dc8be4 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
@@ -1,15 +1,16 @@
 name = Date Repeat Field
 description = Creates the option of Repeating date fields and manages Date fields that use the Date Repeat API.
-dependencies[] = date_api
-dependencies[] = date
-dependencies[] = date_repeat
-stylesheets[all][] = date_repeat_field.css
 package = Date/Time
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+dependencies[] = date:date_api
+dependencies[] = date:date
+dependencies[] = date:date_repeat
+
+stylesheets[all][] = date_repeat_field.css
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
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 d4d4c902..cb57db94 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
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Creates the option of Repeating date fields and manages Date fields that use the Date Repeat API.
+ * Creates the option of Repeating Date fields and manages Date Repeat fields.
  *
  * The Repeating functionality is pretty tightly intermingled with other code,
  * so the process of pulling it out into this module will happen gradually.
@@ -32,7 +32,7 @@ function date_repeat_field_theme() {
         'item' => NULL,
         'entity_type' => NULL,
         'entity' => NULL,
-        'dates' => NULL
+        'dates' => NULL,
       ),
       'function' => 'theme_date_repeat_display',
     ),
@@ -44,9 +44,9 @@ function date_repeat_field_theme() {
 /**
  * Theme the human-readable description for a Date Repeat rule.
  *
- * TODO -
- * add in ways to store the description in the date so it isn't regenerated
- * over and over and find a way to allow description to be shown or hidden.
+ * @todo Add in ways to store the description in the date so it isn't
+ * regenerated over and over and find a way to allow description to be shown or
+ * hidden.
  */
 function theme_date_repeat_display($vars) {
   $field = $vars['field'];
@@ -62,10 +62,9 @@ function theme_date_repeat_display($vars) {
 
 /**
  * Implements hook_menu().
- *
- * Add menu tabs to display pages with details about repeating date values.
  */
 function date_repeat_field_menu() {
+  // Add menu tabs to display pages with details about repeating date values.
   $items = array();
 
   $values = date_repeat_field_bundles();
@@ -126,7 +125,7 @@ function date_repeat_field_permission() {
  *
  * @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.
+ *   and the current user has the permission 'view date repeats'.
  */
 function date_repeat_field_show($entity_type = 'node', $entity = NULL) {
   if (!user_access('view date repeats')) {
@@ -181,7 +180,7 @@ function date_repeat_field_page($entity_type = 'node', $entity = NULL) {
 }
 
 /**
- * Return an array of all entity types and bundles that have repeating date fields.
+ * All entity types and bundles that have repeating date fields.
  */
 function date_repeat_field_bundles() {
   $values = array();
@@ -224,7 +223,6 @@ function date_is_repeat_field($field, $instance = NULL) {
  * Implements hook_date_field_insert_alter().
  */
 function date_repeat_field_date_field_insert_alter(&$items, $context) {
-
   $entity = $context['entity'];
   $field = $context['field'];
   $instance = $context['instance'];
@@ -248,16 +246,16 @@ function date_repeat_field_date_field_insert_alter(&$items, $context) {
  * Implements hook_date_field_update_alter().
  */
 function date_repeat_field_date_field_update_alter(&$items, $context) {
-
   // If an RRULE with a frequency of NONE made it this far, unset it.
   if (!empty($items[0]['rrule']) && strpos($items[0]['rrule'], 'FREQ=NONE')) {
     $items[0]['rrule'] = NULL;
   }
 
-  // If you have a repeating date field on a user and don't check the box to repeat it,
-  // we end up with $items[0]['rrule'] = array('additions' => '', 'exceptions' => ''));
-  // This will clean it up by getting rid of those bogus values.
-  // @TODO Figure out where that's coming from. It doesn't happen on nodes.
+  // If you have a repeating date field on a user and don't check the box to
+  // repeat it, we end up with $items[0]['rrule'] = array('additions' => '',
+  // 'exceptions' => '')); This will clean it up by getting rid of those bogus
+  // values.
+  // @todo Figure out where that's coming from. It doesn't happen on nodes.
   if (!empty($items[0]['rrule']) && is_array($items[0]['rrule'])) {
     $items[0]['rrule'] = NULL;
   }
@@ -267,7 +265,6 @@ function date_repeat_field_date_field_update_alter(&$items, $context) {
  * Implements hook_field_widget_form_alter().
  */
 function date_repeat_field_field_widget_form_alter(&$element, &$form_state, $context) {
-
   $field = $context['field'];
   $instance = $context['instance'];
   $items = $context['items'];
@@ -298,8 +295,7 @@ function date_repeat_field_field_widget_form_alter(&$element, &$form_state, $con
 /**
  * Validation for date repeat form element.
  *
- * Create multiple values from the RRULE results.
- * Lots more work needed here.
+ * Create multiple values from the RRULE results. Lots more work needed here.
  */
 function date_repeat_field_widget_validate($element, &$form_state) {
   $field = field_widget_field($element, $form_state);
@@ -314,9 +310,9 @@ function date_repeat_field_widget_validate($element, &$form_state) {
   // If the widget has been hidden by #access, the RRULE will still be in its
   // original string form here. Nothing to process.
   if (date_hidden_element($element)) {
-
-    // If this was a hidden repeating date, we lost all the repeating values in the widget processing.
-    // Add them back here if that happened since we are skipping the re-creation of those values.
+    // If this was a hidden repeating date, we lost all the repeating values in
+    // the widget processing. Add them back here if that happened since we are
+    // skipping the re-creation of those values.
     if (!empty($form_state['storage']['date_items'][$field_name])) {
       array_pop($element['#parents']);
       form_set_value($element, $form_state['storage']['date_items'][$field_name][$langcode], $form_state);
@@ -327,15 +323,17 @@ function date_repeat_field_widget_validate($element, &$form_state) {
   module_load_include('inc', 'date_repeat', 'date_repeat_form');
   $instance = field_widget_instance($element, $form_state);
 
-  // Here 'values' returns an array of input values, which includes the original RRULE, as a string.
-  // and 'input' returns an array of the form elements created by the repeating date widget, with
-  // RRULE values as an array of the selected elements and their chosen values.
+  // Here 'values' returns an array of input values, which includes the
+  // original RRULE, as a string. and 'input' returns an array of the form
+  // elements created by the repeating date widget, with RRULE values as an
+  // array of the selected elements and their chosen values.
   $item = drupal_array_get_nested_value($form_state['values'], $element['#parents'], $input_exists);
   $input = drupal_array_get_nested_value($form_state['input'], $element['#parents'], $input_exists);
 
   $rrule_values = date_repeat_merge($input['rrule'], $element['rrule']);
 
-  // If no repeat information was set, treat this as a normal, non-repeating value.
+  // If no repeat information was set, treat this as a normal, non-repeating
+  // value.
   if ($rrule_values['FREQ'] == 'NONE' || empty($input['show_repeat_settings'])) {
     $item['rrule'] = NULL;
     form_set_value($element, $item, $form_state);
@@ -373,6 +371,16 @@ function date_repeat_field_widget_validate($element, &$form_state) {
     form_set_error($error_field_count, t("Missing value in 'Range of repeat'. (COUNT).", array(), array('context' => 'Date repeat')));
   }
 
+  $error_field_count = $error_field_base . '][rrule][weekly][INTERVAL';
+  if (isset($rrule_values['INTERVAL']) && isset($rrule_values['FREQ']) && !empty($item['rrule']) && $rrule_values['FREQ'] == 'WEEKLY' && $rrule_values['INTERVAL'] == '') {
+    form_set_error($error_field_count, t('Missing value in Repeats Every # of weeks. (INTERVAL).', array(), array('context' => 'Date repeat')));
+  }
+
+  $error_field_count = $error_field_base . '][rrule][daily][INTERVAL_child';
+  if (isset($rrule_values['INTERVAL']) && isset($rrule_values['FREQ']) && !empty($item['rrule']) && $rrule_values['FREQ'] == 'DAILY' && $rrule_values['INTERVAL'] == '') {
+    form_set_error($error_field_count, t('Missing value in Repeats Every # of days. (INTERVAL).', array(), array('context' => 'Date repeat')));
+  }
+
   if (form_get_errors()) {
     return;
   }
@@ -380,10 +388,8 @@ function date_repeat_field_widget_validate($element, &$form_state) {
   // If the rule, the start date, or the end date have changed, re-calculate
   // the repeating dates, wipe out the previous values, and populate the
   // field with the new values.
-
   $rrule = $item['rrule'];
   if (!empty($rrule)) {
-
     // Avoid undefined index problems on dates that don't have all parts.
     $possible_items = array('value', 'value2', 'timezone', 'offset', 'offset2');
     foreach ($possible_items as $key) {
@@ -392,8 +398,9 @@ function date_repeat_field_widget_validate($element, &$form_state) {
       }
     }
 
-    // We only collect a date for UNTIL, but we need it to be inclusive,
-    // so force it to a full datetime element at the last possible second of the day.
+    // We only collect a date for UNTIL, but we need it to be inclusive, so
+    // force it to a full datetime element at the last possible second of the
+    // day.
     if (!empty($rrule_values['UNTIL'])) {
       $gran = array('year', 'month', 'day', 'hour', 'minute', 'second');
       $rrule_values['UNTIL']['datetime'] .= ' 23:59:59';
@@ -403,17 +410,17 @@ function date_repeat_field_widget_validate($element, &$form_state) {
     $value = date_repeat_build_dates($rrule, $rrule_values, $field, $item);
     // Unset the delta value of the parents.
     array_pop($element['#parents']);
-    // Set the new delta values for this item to the array of values returned by the repeat rule.
+    // Set the new delta values for this item to the array of values returned
+    // by the repeat rule.
     form_set_value($element, $value, $form_state);
   }
 }
 
 /**
  * Implements the form after_build().
- *
- * Remove the 'Add more' elements from a repeating date form.
  */
 function date_repeat_after_build(&$element, &$form_state) {
+  // Remove the 'Add more' elements from a repeating date form.
   foreach ($form_state['storage']['repeat_fields'] as $field_name => $parents) {
     // Remove unnecessary items in the form added by the Add more handling.
     $value = drupal_array_get_nested_value($element, $parents);
@@ -429,12 +436,10 @@ function date_repeat_after_build(&$element, &$form_state) {
 /**
  * Helper function to build repeating dates from a $node_field.
  *
- * Pass in either the RRULE or the $form_values array for the RRULE,
- * whichever is missing will be created when needed.
+ * Pass in either the RRULE or the $form_values array for the RRULE, whichever
+ * is missing will be created when needed.
  */
-// @codingStandardsIgnoreStart
 function date_repeat_build_dates($rrule = NULL, $rrule_values = NULL, $field, $item) {
-// @codingStandardsIgnoreEnd
   include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'date_api') . '/date_api_ical.inc';
   $field_name = $field['field_name'];
 
@@ -445,9 +450,9 @@ function date_repeat_build_dates($rrule = NULL, $rrule_values = NULL, $field, $i
     $rrule_values = date_ical_parse_rrule(NULL, $rrule);
   }
 
-  // By the time we get here, the start and end dates have been
-  // adjusted back to UTC, but we want localtime dates to do
-  // things like '+1 Tuesday', so adjust back to localtime.
+  // By the time we get here, the start and end dates have been adjusted back to
+  // UTC, but we want localtime dates to do things like '+1 Tuesday', so adjust
+  // back to localtime.
   $timezone = date_get_timezone($field['settings']['tz_handling'], $item['timezone']);
   $timezone_db = date_get_timezone_db($field['settings']['tz_handling']);
   $start = new DateObject($item['value'], $timezone_db, date_type_format($field['type']));
@@ -497,13 +502,13 @@ function date_repeat_build_dates($rrule = NULL, $rrule_values = NULL, $field, $i
   $dates = date_repeat_calc($rrule, $start_datetime, $end_datetime, $exceptions, $timezone, $additions);
   $value = array();
   foreach ($dates as $delta => $date) {
-    // date_repeat_calc always returns DATE_DATETIME dates, which is
-    // not necessarily $field['type'] dates.
-    // Convert returned dates back to db timezone before storing.
+    // date_repeat_calc always returns DATE_DATETIME dates, which is not
+    // necessarily $field['type'] dates. Convert returned dates back to db
+    // timezone before storing.
     $date_start = new DateObject($date, $timezone, DATE_FORMAT_DATETIME);
     $date_start->limitGranularity($field['settings']['granularity']);
     date_timezone_set($date_start, timezone_open($timezone_db));
-    $date_end = clone($date_start);
+    $date_end = clone $date_start;
     date_modify($date_end, '+' . $duration . ' seconds');
     $value[$delta] = array(
       'value' => date_format($date_start, date_type_format($field['type'])),
@@ -520,20 +525,17 @@ function date_repeat_build_dates($rrule = NULL, $rrule_values = NULL, $field, $i
 
 /**
  * Implements hook_date_combo_process_alter().
- *
- * This hook lets us make changes to the date_combo element.
  */
 function date_repeat_field_date_combo_process_alter(&$element, &$form_state, $context) {
-
+  // This hook lets us make changes to the date_combo element.
   $field = $context['field'];
   $instance = $context['instance'];
   $field_name = $element['#field_name'];
   $delta = $element['#delta'];
 
-  // Add a date repeat form element, if needed.
-  // We delayed until this point so we don't bother adding it to hidden fields.
+  // Add a date repeat form element, if needed. We delayed until this point so
+  // we don't bother adding it to hidden fields.
   if (date_is_repeat_field($field, $instance)) {
-
     $item = $element['#value'];
     $element['rrule'] = array(
       '#type' => 'date_repeat_rrule',
@@ -551,26 +553,22 @@ function date_repeat_field_date_combo_process_alter(&$element, &$form_state, $co
       '#weight' => $instance['widget']['weight'] + .4,
     );
   }
-
 }
 
 /**
  * Implements hook_date_combo_pre_validate_alter().
- *
- * This hook lets us alter the element or the form_state before the rest
- * of the date_combo validation gets fired.
  */
 function date_repeat_field_date_combo_pre_validate_alter(&$element, &$form_state, $context) {
+  // This hook lets us alter the element or the form_state before the rest of
+  // the date_combo validation gets fired.
   // Just a placeholder for now.
 }
 
 /**
  * Implements hook_field_info_alter().
- *
- * This Field API hook lets us add a new setting to the fields.
  */
 function date_repeat_field_field_info_alter(&$info) {
-
+  // This Field API hook lets us add a new setting to the fields.
   $info['date']['settings'] += array(
     'repeat' => 0,
   );
@@ -584,11 +582,9 @@ function date_repeat_field_field_info_alter(&$info) {
 
 /**
  * Implements hook_field_formatter_info_alter().
- *
- * This hook lets us add settings to the formatters.
  */
 function date_repeat_field_field_formatter_info_alter(&$info) {
-
+  // This hook lets us add settings to the formatters.
   if (isset($info['date_default'])) {
     $info['date_default']['settings'] += array(
       'show_repeat_rule' => 'show',
@@ -598,11 +594,9 @@ function date_repeat_field_field_formatter_info_alter(&$info) {
 
 /**
  * Implements hook_field_widget_info_alter().
- *
- * This Field API hook lets us add a new setting to the widgets.
  */
 function date_repeat_field_field_widget_info_alter(&$info) {
-
+  // This Field API hook lets us add a new setting to the widgets.
   $info['date_text']['settings'] += array(
     'repeat_collapsed' => 0,
   );
@@ -618,11 +612,9 @@ function date_repeat_field_field_widget_info_alter(&$info) {
 
 /**
  * Implements hook_date_field_settings_form_alter().
- *
- * This hook lets us alter the field settings form.
  */
 function date_repeat_field_date_field_settings_form_alter(&$form, $context) {
-
+  // This hook lets us alter the field settings form.
   $field = $context['field'];
   $instance = $context['instance'];
   $has_data = $context['has_data'];
@@ -649,7 +641,8 @@ function date_repeat_field_form_field_ui_field_edit_form_alter(&$form, &$form_st
     return;
   }
 
-  // If using repeating dates, override the Field module's handling of the multiple values option.
+  // If using repeating dates, override the Field module's handling of the
+  // multiple values option.
   if (date_is_repeat_field($field, $instance)) {
     $form['field']['cardinality']['#disabled'] = TRUE;
     $form['field']['cardinality']['#value'] = FIELD_CARDINALITY_UNLIMITED;
@@ -659,7 +652,7 @@ function date_repeat_field_form_field_ui_field_edit_form_alter(&$form, &$form_st
 }
 
 /**
- * Ensure the cardinality gets updated if the option to make a date repeating is checked.
+ * Ensure the cardinality is updated if the date can repeat.
  */
 function date_repeat_field_set_cardinality($element, &$form_state) {
   if (!empty($form_state['values']['field']['settings']['repeat'])) {
@@ -669,20 +662,17 @@ function date_repeat_field_set_cardinality($element, &$form_state) {
 
 /**
  * Implements hook_date_field_instance_settings_form_alter().
- *
- * This hook lets us alter the field instance settings form.
  */
 function date_repeat_field_date_field_instance_settings_form_alter(&$form, $context) {
-  // Just a placeholder for now.
+  // This hook lets us alter the field instance settings form. Just a
+  // placeholder for now.
 }
 
 /**
  * Implements hook_date_field_widget_settings_form_alter().
- *
- * This hook lets us alter the field widget settings form.
  */
 function date_repeat_field_date_field_widget_settings_form_alter(&$form, $context) {
-
+  // This hook lets us alter the field widget settings form.
   $field = $context['field'];
   $instance = $context['instance'];
 
@@ -692,7 +682,7 @@ function date_repeat_field_date_field_widget_settings_form_alter(&$form, $contex
       '#default_value' => 1,
       '#options' => array(
         0 => t('Expanded', array(), array('context' => 'Date repeat')),
-        1 => t('Collapsed', array(), array('context' => 'Date repeat'))
+        1 => t('Collapsed', array(), array('context' => 'Date repeat')),
       ),
       '#title' => t('Repeat display', array(), array('context' => 'Date repeat')),
       '#description' => t("Should the repeat options form start out expanded or collapsed? Set to 'Collapsed' to make those options less obtrusive.", array(), array('context' => 'Date repeat')),
@@ -703,11 +693,9 @@ function date_repeat_field_date_field_widget_settings_form_alter(&$form, $contex
 
 /**
  * Implements hook_date_field_foramatter_settings_form_alter().
- *
- * This hook lets us alter the field formatter settings form.
  */
 function date_repeat_field_date_field_formatter_settings_form_alter(&$form, &$form_state, $context) {
-
+  // This hook lets us alter the field formatter settings form.
   $field = $context['field'];
   $instance = $context['instance'];
   $view_mode = $context['view_mode'];
@@ -730,11 +718,9 @@ function date_repeat_field_date_field_formatter_settings_form_alter(&$form, &$fo
 
 /**
  * Implements hook_date_field_foramatter_settings_summary_alter().
- *
- * This hook lets us alter the field formatter settings summary.
  */
 function date_repeat_field_date_field_formatter_settings_summary_alter(&$summary, $context) {
-
+  // This hook lets us alter the field formatter settings summary.
   $field = $context['field'];
   $instance = $context['instance'];
   $view_mode = $context['view_mode'];
diff --git a/drupal7/sites/all/modules/date/date_tools/date_tools.change_type.inc b/drupal7/sites/all/modules/date/date_tools/date_tools.change_type.inc
index 041c5dea..b4c9350d 100644
--- a/drupal7/sites/all/modules/date/date_tools/date_tools.change_type.inc
+++ b/drupal7/sites/all/modules/date/date_tools/date_tools.change_type.inc
@@ -10,10 +10,11 @@
  *
  * @see date_tools_change_type_form_validate()
  * @see date_tools_change_type_form_submit()
+ *
+ * @todo This is broken, still needs to be adjusted for the D6->D7 changes.
  */
 function date_tools_change_type_form() {
   $form = array();
-  // This is broken, still needs to be adjusted for the D6->D7 changes.
   drupal_set_message(t('This operation does not yet work for the Drupal 7 version.'), 'error');
   return $form;
   $fields = content_fields();
@@ -31,7 +32,7 @@ function date_tools_change_type_form() {
       $date_options[$labels[$field['type']]][$field_name] = t('Field @label (@field_name)', array(
         '@label' => $field['widget']['label'],
         '@field_name' => $field_name,
-        '@type' => $labels[$field['type']]
+        '@type' => $labels[$field['type']],
       ));
     }
   }
@@ -94,13 +95,11 @@ function date_tools_change_type_form_submit($form, &$form_state) {
     $labels[$type] = $info['label'];
   }
 
-  // Is there any data in this field? If not, we can
-  // skip some steps.
+  // Is there any data in this field? If not, we can skip some steps.
   $has_data = db_query("SELECT COUNT(*) FROM {" . $table . "}")->fetchField();
 
-  // Create a backup copy of the original values.
-  // The values are going to get corrupted when we
-  // change the column type.
+  // Create a backup copy of the original values. The values are going to get
+  // corrupted when we change the column type.
   if ($has_data) {
     $temp_table = $table . '_temp';
     db_query("CREATE TABLE {" . $temp_table . "} SELECT * FROM {" . $table . "}");
@@ -115,7 +114,9 @@ function date_tools_change_type_form_submit($form, &$form_state) {
   // If there's no data to update, we're finished.
   if (!$has_data) {
     drupal_set_message(t('The field @field_name has been changed from @old_type to @new_type.', array(
-    '@field_name' => $field['widget']['label'], '@old_type' => $labels[$old_type], '@new_type' => $labels[$new_type])));
+    '@field_name' => $field['widget']['label'],
+    '@old_type' => $labels[$old_type],
+    '@new_type' => $labels[$new_type])));
     return;
   }
 
@@ -190,6 +191,6 @@ function date_tools_change_type_form_submit($form, &$form_state) {
   drupal_set_message(t('The field @field_name has been changed from @old_type to @new_type.', array(
     '@field_name' => $field['widget']['label'],
     '@old_type' => $labels[$old_type],
-    '@new_type' => $labels[$new_type]
+    '@new_type' => $labels[$new_type],
   )));
 }
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 04bfb03f..ff2b0b1f 100644
--- a/drupal7/sites/all/modules/date/date_tools/date_tools.info
+++ b/drupal7/sites/all/modules/date/date_tools/date_tools.info
@@ -1,14 +1,16 @@
 name = Date Tools
 description = Tools to import and auto-create dates and calendars.
-dependencies[] = date
 package = Date/Time
 core = 7.x
 configure = admin/config/date/tools
-files[] = tests/date_tools.test
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+dependencies[] = date:date
+
+; Test coverage.
+files[] = tests/DateToolsTestCase.test
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/date_tools/date_tools.module b/drupal7/sites/all/modules/date/date_tools/date_tools.module
index 997808df..917c2e11 100644
--- a/drupal7/sites/all/modules/date/date_tools/date_tools.module
+++ b/drupal7/sites/all/modules/date/date_tools/date_tools.module
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * @todo.
+ * Primary hook implementations for the Date Tools module
  */
 
 /**
@@ -17,11 +17,10 @@ function date_tools_help($section, $arg) {
       return '<p>' . t('Change a date field from one type to another. Very experimental, use at your own risk!') . '</p>';
 
     case 'admin/config/date/tools/date_wizard':
-
-      $output = t("Fill out the following form to auto-create a date content type, with a datetime field and matching pre-configured calendar. If the calendar module is enabled and the option to create a calendar is chosen, a calendar and upcoming events block will be created, an ical feed will be added to the calendar. Nodes created from this new content type will include a link to the calendar, and the calendar will have a link to the 'add new date' form. You can also add new date fields to an existing content type by entering the existing content type name instead of creating a new one.") .
-      '</p><p>' .
-      t('Only a limited set of options are displayed here to make this easy to set up. Once the date has been created you will be able to make other changes to the date settings and add other fields to your new content type on the Manage fields screen. You can also make changes to the calendar on the Views edit page.') .
-      '</p>';
+      $output = t("Fill out the following form to auto-create a date content type, with a datetime field and matching pre-configured calendar. If the calendar module is enabled and the option to create a calendar is chosen, a calendar and upcoming events block will be created, an ical feed will be added to the calendar. Nodes created from this new content type will include a link to the calendar, and the calendar will have a link to the 'add new date' form. You can also add new date fields to an existing content type by entering the existing content type name instead of creating a new one.");
+      $output .= '</p><p>';
+      $output .= t('Only a limited set of options are displayed here to make this easy to set up. Once the date has been created you will be able to make other changes to the date settings and add other fields to your new content type on the Manage fields screen. You can also make changes to the calendar on the Views edit page.');
+      $output .= '</p>';
       return $output;
   }
 }
@@ -41,12 +40,11 @@ function date_tools_permission() {
  * Implements hook_menu().
  */
 function date_tools_menu() {
-
   $items = array();
   $items['admin/config/date/tools'] = array(
-    'title'    => 'Date Tools',
+    'title' => 'Date Tools',
     'description' => 'Date Wizard and other tools to manage and create dates and calendars. ',
-    'access arguments'   => array('administer date tools'),
+    'access arguments' => array('administer date tools'),
     'page callback' => 'date_tools_page',
   );
   $items['admin/config/date/tools/about'] = array(
@@ -68,19 +66,15 @@ function date_tools_menu() {
     'file' => 'date_tools.wizard.inc',
   );
 
-  // @codingStandardsIgnoreStart
-  /**
-  $items['admin/config/date/tools/change'] = array(
-    'title'    => 'Change type',
-    'access arguments'   => array('administer date tools'),
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('date_tools_change_type_form'),
-    'type' => MENU_LOCAL_TASK,
-    'weight' => 3,
-    'file' => 'date_tools.change_type.inc',
-  );
-  */
-  // @codingStandardsIgnoreEnd
+  // $items['admin/config/date/tools/change'] = array(
+  //   'title' => 'Change type',
+  //   'access arguments' => array('administer date tools'),
+  //   'page callback' => 'drupal_get_form',
+  //   'page arguments' => array('date_tools_change_type_form'),
+  //   'type' => MENU_LOCAL_TASK,
+  //   'weight' => 3,
+  //   'file' => 'date_tools.change_type.inc',
+  // );
 
   return $items;
 }
@@ -89,9 +83,5 @@ function date_tools_menu() {
  * Main Date Tools page.
  */
 function date_tools_page() {
-  $content = '';
-
-  $content .= t('Dates and calendars can be complicated to set up. The !date_wizard makes it easy to create a simple date content type and related calendar.', array('!date_wizard' => l(t('Date wizard'), 'admin/config/date/tools/date_wizard')));
-
-  return $content;
+  return t('Dates and calendars can be complicated to set up. The !date_wizard makes it easy to create a simple date content type and related calendar.', array('!date_wizard' => l(t('Date wizard'), 'admin/config/date/tools/date_wizard')));
 }
diff --git a/drupal7/sites/all/modules/date/date_tools/date_tools.wizard.inc b/drupal7/sites/all/modules/date/date_tools/date_tools.wizard.inc
index 94a130a4..7ffee4dd 100644
--- a/drupal7/sites/all/modules/date/date_tools/date_tools.wizard.inc
+++ b/drupal7/sites/all/modules/date/date_tools/date_tools.wizard.inc
@@ -7,8 +7,6 @@
 
 /**
  * Implements hook_form().
- *
- * @todo.
  */
 function date_tools_wizard_form() {
   $form = array();
@@ -112,6 +110,12 @@ function date_tools_wizard_form() {
     '#title' => t('Date timezone handling'),
     '#description' => t("Timezone handling should be set to 'none' for granularity without time elements."),
   );
+  $form['field']['advanced']['weight'] = array(
+    '#type' => 'textfield',
+    '#default_value' => '-4',
+    '#title' => t('Weight'),
+    '#description' => t("Set the field weight."),
+  );
   $form['calendar'] = array(
     '#type' => 'select',
     '#default_value' => module_exists('calendar'),
@@ -131,9 +135,7 @@ function date_tools_wizard_form() {
 }
 
 /**
- * Form validate.
- *
- * @todo.
+ * Form validation.
  */
 function date_tools_wizard_form_validate(&$form, &$form_state) {
   $bundle = $form_state['values']['bundle'];
@@ -173,8 +175,6 @@ function date_tools_wizard_form_validate(&$form, &$form_state) {
 
 /**
  * Form submit.
- *
- * @todo.
  */
 function date_tools_wizard_form_submit(&$form, &$form_state) {
   $view_name = date_tools_wizard_build($form_state['values']);
@@ -189,8 +189,6 @@ function date_tools_wizard_form_submit(&$form, &$form_state) {
 
 /**
  * Wizard build.
- *
- * @todo.
  */
 function date_tools_wizard_build($form_values) {
   extract($form_values);
@@ -198,9 +196,8 @@ function date_tools_wizard_build($form_values) {
   $field_name = 'field_' . $field_name;
   $base_table = 'node';
 
-  // Create a node type if it doesn't already exist.
-  // This makes it possible to add additional date fields to
-  // an existing type.
+  // Create a node type if it doesn't already exist. This makes it possible to
+  // add additional date fields to an existing type.
   $types = node_type_get_names();
   $type_settings = array();
   if (!array_key_exists($bundle, $types)) {
@@ -238,7 +235,7 @@ function date_tools_wizard_build($form_values) {
     'label' => $label,
     'bundle' => $bundle,
     // Move the date right below the title.
-    'weight' => -4,
+    'weight' => $weight,
     'widget' => array(
       'type' => $widget_type,
       // Increment for minutes and seconds, can be 1, 5, 10, 15, or 30.
@@ -252,7 +249,7 @@ function date_tools_wizard_build($form_values) {
         'label_position' => 'above',
         'repeat_collapsed' => 0,
       ),
-      'weight' => -4,
+      'weight' => $weight,
     ),
     'settings' => array(
       'default_value' => 'now',
@@ -295,8 +292,8 @@ function date_tools_wizard_build($form_values) {
   $instance = field_create_instance($instance);
   $view_name = 'calendar_node_' . $field_name;
 
-  field_info_cache_clear(TRUE);
-  field_cache_clear(TRUE);
+  field_info_cache_clear();
+  field_cache_clear();
 
   drupal_set_message(t('Your date field @name has been created.', array('@name' => $label)));
 
@@ -305,8 +302,6 @@ function date_tools_wizard_build($form_values) {
 
 /**
  * Includes handler.
- *
- * @todo.
  */
 function date_tools_wizard_include() {
   module_load_include('inc', 'node', 'content_types');
@@ -317,8 +312,6 @@ function date_tools_wizard_include() {
 
 /**
  * Implements hook_field_types().
- *
- * @todo.
  */
 function date_tools_wizard_field_types() {
   $field_types = array();
@@ -330,7 +323,6 @@ function date_tools_wizard_field_types() {
 
 /**
  * Implements hook_widget_types().
- * @todo.
  */
 function date_tools_wizard_widget_types() {
   $widget_types = array();
@@ -344,8 +336,6 @@ function date_tools_wizard_widget_types() {
 
 /**
  * Tz handler.
- *
- * @todo.
  */
 function date_tools_wizard_tz_handling() {
   include_once drupal_get_path('module', 'date') . '/date_admin.inc';
@@ -354,11 +344,8 @@ function date_tools_wizard_tz_handling() {
 
 /**
  * Create date tools wizard content type.
- *
- * @todo.
  */
 function date_tools_wizard_create_content_type($name, $bundle, $description, $type_settings = array()) {
-
   date_tools_wizard_include();
 
   // Create the content type.
@@ -427,5 +414,4 @@ function date_tools_wizard_create_content_type($name, $bundle, $description, $ty
     ),
   );
   field_create_instance($instance);
-
 }
diff --git a/drupal7/sites/all/modules/date/date_tools/tests/date_tools.test b/drupal7/sites/all/modules/date/date_tools/tests/DateToolsTestCase.test
similarity index 79%
rename from drupal7/sites/all/modules/date/date_tools/tests/date_tools.test
rename to drupal7/sites/all/modules/date/date_tools/tests/DateToolsTestCase.test
index 07af4a3d..f481d83e 100644
--- a/drupal7/sites/all/modules/date/date_tools/tests/date_tools.test
+++ b/drupal7/sites/all/modules/date/date_tools/tests/DateToolsTestCase.test
@@ -5,6 +5,9 @@
  * Tests for Date Tools.
  */
 
+/**
+ * Tests for Date Tools.
+ */
 class DateToolsTestCase extends DrupalWebTestCase {
   protected $privileged_user;
 
@@ -20,16 +23,26 @@ class DateToolsTestCase extends DrupalWebTestCase {
   }
 
   /**
-   * @todo.
+   * {@inheritdoc}
    */
-  public function setUp() {
-    // Load the date_api module.
-    parent::setUp('field', 'field_ui', 'date_api', 'date', 'date_popup', 'date_tools');
+  public function setUp(array $modules = array()) {
+    $modules[] = 'field';
+    $modules[] = 'field_ui';
+    $modules[] = 'date_api';
+    $modules[] = 'date';
+    $modules[] = 'date_popup';
+    $modules[] = 'date_tools';
+    parent::setUp($modules);
 
     // Create and log in our privileged user.
-    $this->privileged_user = $this->drupalCreateUser(
-      array('administer content types', 'administer nodes', 'bypass node access', 'administer date tools', 'administer fields')
+    $perms = array(
+      'administer content types',
+      'administer nodes',
+      'bypass node access',
+      'administer date tools',
+      'administer fields',
     );
+    $this->privileged_user = $this->drupalCreateUser($perms);
     $this->drupalLogin($this->privileged_user);
 
     variable_set('date_format_long', 'D, m/d/Y - H:i');
@@ -39,7 +52,12 @@ class DateToolsTestCase extends DrupalWebTestCase {
    * Creates a date field using the Date Wizard.
    */
   public function testTools() {
-    $form_values = array('label' => 'Test', 'field_type' => 'datetime', 'widget_type' => 'date_select', 'todate' => '');
+    $form_values = array(
+      'label' => 'Test',
+      'field_type' => 'datetime',
+      'widget_type' => 'date_select',
+      'todate' => '',
+    );
     $this->createDateWizard($form_values);
     $this->dateForm($options = 'select');
     $this->assertText('Thu, 10/07/2010 - 10:30', 'Found the correct date for the Date Wizard datetime field using the date_select widget.');
@@ -72,7 +90,7 @@ class DateToolsTestCase extends DrupalWebTestCase {
   }
 
   /**
-   * @todo.
+   * @todo
    */
   function deleteDateField() {
     $this->drupalGet('admin/structure/types/manage/story/fields');
@@ -97,6 +115,7 @@ class DateToolsTestCase extends DrupalWebTestCase {
       'granularity[]' => array('year', 'month', 'day', 'hour', 'minute'),
       'tz_handling' => 'site',
       'year_range' => '2010:+2',
+      'weight' => -100,
     );
     $this->drupalPost('admin/config/date/tools/date_wizard', $edit, t('Save'));
     $this->assertText('Your date field Test has been created.', 'Create a date field using the Date Wizard.');
diff --git a/drupal7/sites/all/modules/date/date_views/css/date_views.css b/drupal7/sites/all/modules/date/date_views/css/date_views.css
index a0121ea9..c89d1872 100644
--- a/drupal7/sites/all/modules/date/date_views/css/date_views.css
+++ b/drupal7/sites/all/modules/date/date_views/css/date_views.css
@@ -1,4 +1,9 @@
-/* Pager plugin css */
+/**
+ * @file
+ * Custom CSS for the Date Views module.
+ */
+
+/* Pager plugin. */
 div.date-views-pager {
   margin-left: auto;
   margin-right: auto;
@@ -19,7 +24,7 @@ div.date-views-pager div.next-year {
 }
 
 
-/* Views filter form css */
+/* Views filter form. */
 .views-group-box div.date-views-filter-fieldset {
   margin-left: 0;
 }
@@ -47,9 +52,10 @@ div.date-views-pager div.next-year {
 }
 
 /**
- * Style Header
+ * Style Header.
+ * Give the navigation bar a little extra padding below so it will clear the
+ * new contextual links overlay of the teasers below it.
  */
-/* Give the navigation bar a little extra padding below so it will clear the new contextual links overlay of the teasers below it. */
 .date-nav {
   clear: both;
   padding-bottom: 1.5em;
@@ -64,7 +70,7 @@ div.date-views-pager div.next-year {
   margin-bottom: 10px;
 }
 
-.date-nav-wrapper  {
+.date-nav-wrapper {
   position: relative;
   margin-top: 5px;
   width: 100%;
@@ -139,4 +145,4 @@ div.date-views-pager div.next-year {
 .date-nav-wrapper .date-next a {
   margin-right: 10px;
   font-weight: bold;
-}
\ No newline at end of file
+}
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 68b32cc2..bc19f3a2 100644
--- a/drupal7/sites/all/modules/date/date_views/date_views.info
+++ b/drupal7/sites/all/modules/date/date_views/date_views.info
@@ -1,10 +1,12 @@
 name = Date Views
 description = Views integration for date fields and date functionality.
 package = Date/Time
-dependencies[] = date_api
-dependencies[] = views
 core = 7.x
 php = 5.2
+
+dependencies[] = date:date_api
+dependencies[] = views:views
+
 files[] = includes/date_views_argument_handler.inc
 files[] = includes/date_views_argument_handler_simple.inc
 files[] = includes/date_views_filter_handler.inc
@@ -12,9 +14,12 @@ 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 2017-04-07
-version = "7.x-2.10"
+; Test coverage.
+files[] = tests/date_views_filter.test
+files[] = tests/date_views_pager.test
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
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 c050e56e..59277a93 100644
--- a/drupal7/sites/all/modules/date/date_views/date_views.module
+++ b/drupal7/sites/all/modules/date/date_views/date_views.module
@@ -26,7 +26,6 @@ function date_views_menu() {
  * 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'),
@@ -76,15 +75,13 @@ function date_views_settings($form, &$form_state) {
   );
 
   return system_settings_form($form);
-
 }
 
 /**
  * Implements hook_views_api().
- *
- * This one is used as the base to reduce errors when updating.
  */
 function date_views_theme() {
+  // This one is used as the base to reduce errors when updating.
   $path = drupal_get_path('module', 'date_views');
   $base = array(
     'file' => 'theme.inc',
@@ -165,23 +162,29 @@ function date_views_fields($base = 'node', $reset = FALSE) {
 
 /**
  * Implements hook_date_views_entities().
- *
- * Map extra Views tables to the entity that holds its date fields, needed for Views tables other than the primary tables identified in entity_info().
  */
 function date_views_date_views_extra_tables() {
+  // Map extra Views tables to the entity that holds its date fields, needed
+  // for Views tables other than the primary tables identified in entity_info().
   return array(
     'node_revision' => 'node',
   );
 }
 
 /**
- * Helper function to map entity types to the Views base table they use, to make it easier to infer the entity type from a base table.
+ * Helper function to map entity types to the Views base table they use.
+ *
+ * Used to make it easier to infer the entity type from a base table.
  *
- * Views has a new handler called views_handler_field_entity() that loads entities.
+ * Views has a new handler called views_handler_field_entity() that loads
+ * entities.
  *
- * And you can use something like the following to get the entity type from a view, but not all our base tables contain the entity information we need, (i.e. revisions).
+ * And you can use something like the following to get the entity type from a
+ * view, but not all our base tables contain the entity information we need,
+ * (i.e. revisions).
  *
- * So it won't work here and we resort to creating information from entity_get_info().
+ * So it won't work here and we resort to creating information from
+ * entity_get_info().
  *
  *   // A method to get the entity type for a base table.
  *   $table_data = views_fetch_data($base_table);
@@ -194,7 +197,6 @@ function date_views_base_tables() {
   $base_tables = &drupal_static(__FILE__, array());
 
   if (empty($base_tables)) {
-
     // First we get the base tables we can learn about from entity_info.
     $entity_info = entity_get_info();
     foreach ($entity_info as $entity_type => $info) {
@@ -206,7 +208,8 @@ function date_views_base_tables() {
       }
     }
 
-    // Then we let other modules tell us about other entity tables that hold date fields.
+    // Then we let other modules tell us about other entity tables that hold
+    // date fields.
     $base_tables += module_invoke_all('date_views_extra_tables');
   }
 
@@ -215,10 +218,12 @@ function date_views_base_tables() {
 
 /**
  * Implements hook_date_views_fields().
- *
- * All modules that create custom fields that use the 'views_handler_field_date' handler can provide additional information here about the type of date they create so the date can be used by the Date API views date argument and date filter.
  */
 function date_views_date_views_fields($field) {
+  // All modules that create custom fields that use the
+  // 'views_handler_field_date' handler can provide additional information here
+  // about the type of date they create so the date can be used by the Date API
+  // views date argument and date filter.
   $values = array(
     // The type of date: DATE_UNIX, DATE_ISO, DATE_DATETIME.
     'sql_type' => DATE_UNIX,
@@ -249,11 +254,11 @@ function date_views_date_views_fields($field) {
 }
 
 /**
- * A version of date_real_url that formats links correctly for the new Date pager.
+ * A version of date_real_url that formats links correctly for the Date pager.
  */
 function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_url = FALSE, $absolute = TRUE) {
-
-  // If someone adds a pager without a matching argument, there is not date information to work with.
+  // If someone adds a pager without a matching argument, there is not date
+  // information to work with.
   if (empty($view->date_info) || !isset($view->date_info->date_arg_pos)) {
     return '';
   }
@@ -261,13 +266,12 @@ function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_
   $args = $view->args;
   $pos = $view->date_info->date_arg_pos;
 
-  // The View arguments array is indexed numerically but is not necessarily
-  // in numerical order. Sort the arguments to ensure the correct order.
+  // The View arguments array is indexed numerically but is not necessarily in
+  // numerical order. Sort the arguments to ensure the correct order.
   ksort($args);
 
-  // If there are empty arguments before the date argument,
-  // pad them with the wildcard so the date argument will be in
-  // the right position.
+  // If there are empty arguments before the date argument, pad them with the
+  // wildcard so the date argument will be in the right position.
   if (count($args) < $pos) {
     foreach ($view->argument as $name => $argument) {
       if ($argument->position == $pos) {
@@ -293,7 +297,6 @@ function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_
 
       default:
         $args[$pos] = date_pad($view->date_info->year, 4) . '-' . date_pad($view->date_info->month);
-        break;
     }
   }
   elseif (!empty($date_arg)) {
@@ -302,11 +305,10 @@ function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_
   else {
     $args = $view->args;
   }
-  // Is this an embedded or a block view?
-  // Return the pager query value.
-  if (!$force_view_url &&
-  (!empty($view->preview) || !empty($view->date_info->block_identifier))) {
 
+  // Is this an embedded or a block view? Return the pager query value.
+  if (!$force_view_url &&
+      (!empty($view->preview) || !empty($view->date_info->block_identifier))) {
     $url = $args[$pos];
     $key = date_block_identifier($view);
     if (!empty($key)) {
@@ -316,8 +318,8 @@ function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_
     }
   }
 
-  // Normal views may need querystrings appended to them
-  // if they use exposed filters.
+  // Normal views may need querystrings appended to them if they use exposed
+  // filters.
   return url($view->get_url($args), array(
     'query' => date_views_querystring($view),
     'absolute' => $absolute,
@@ -337,12 +339,12 @@ function date_block_identifier($view) {
 
 /**
  * Implements hook_field_views_data_alter().
- *
- * Create a Views field for each date column we care about to supplement the generic 'entity_id' and 'revision_id' fields that are automatically created.
- *
- * Also use friendlier labels to distinguish the start date and end date in listings (for fields that use both).
  */
 function date_views_field_views_data_alter(&$result, $field, $module) {
+  // Create a Views field for each date column we care about to supplement the
+  // generic 'entity_id' and 'revision_id' fields that are automatically
+  // created. Also use friendlier labels to distinguish the start date and end
+  // date in listings (for fields that use both).
   if ($module == 'date') {
     $has_end_date = !empty($field['settings']['todate']);
     if ($has_end_date) {
@@ -358,8 +360,9 @@ function date_views_field_views_data_alter(&$result, $field, $module) {
         // The old values are still there with a 'moved to' key, so ignore them.
         if (array_key_exists('field', $value) && !array_key_exists('moved to', $value['field'])) {
           $result[$table][$column]['field']['is date'] = TRUE;
-          // Not sure yet if we still need a custom field handler in D7 now that custom formatters are available.
-          // Might still need it to handle grouping of multiple value dates.
+          // Not sure yet if we still need a custom field handler in D7 now
+          // that custom formatters are available. Might still need it to
+          // handle grouping of multiple value dates.
           // $result[$table][$column]['field']['handler'] = 'date_handler_field_date';
           // $result[$table][$column]['field']['add fields to query'] = TRUE;
         }
@@ -458,9 +461,35 @@ function date_views_form_views_ui_edit_form_alter(&$form, &$form_state, $form_id
 }
 
 /**
- * The instanceof function makes this work for any handler that was derived from 'views_handler_filter_date' or 'views_handler_argument_date', which includes core date fields like the node updated field.
+ * Implements hook_form_FORM_ID_alter() for views_exposed_form().
+ */
+function date_views_form_views_exposed_form_alter(&$form, &$form_state, $form_id) {
+  $children = element_children($form);
+  // @todo On a stock views_exposed_form, there won't be any grandchildren
+  // items, but will this always be the case? How about better_exposed_filters?
+  foreach ($children as $child) {
+    if (isset($form[$child]['#id']) && strpos($form[$child]['#id'], 'date_views_exposed_filter-') === 0) {
+      // Remove empty or scalar date input when an array was expected.
+      if (empty($form_state['input'][$child]) || !is_array($form_state['input'][$child])) {
+        unset($form_state['input'][$child]);
+      }
+      elseif (empty($form_state['input'][$child]['value']) || !is_array($form_state['input'][$child]['value'])) {
+        unset($form_state['input'][$child]['value']);
+      }
+    }
+  }
+}
+
+/**
+ * Work out if the plugin is a date.
  *
- * The test for $handler->min_date tells us that this is an argument that not only is derived from the views date handler but also has been processed by the Date Views filter or argument code.
+ * The instanceof function makes this work for any handler that was derived from
+ * 'views_handler_filter_date' or 'views_handler_argument_date', which includes
+ * core date fields like the node updated field.
+ *
+ * The test for $handler->min_date tells us that this is an argument that not
+ * only is derived from the views date handler but also has been processed by
+ * the Date Views filter or argument code.
  */
 function date_views_handler_is_date($handler, $type = 'argument') {
   switch ($type) {
@@ -476,7 +505,8 @@ function date_views_handler_is_date($handler, $type = 'argument') {
 /**
  * Validation hook for exposed filters that use the select widget.
  *
- * This is to ensure the the user completes all parts of the date not just some parts. Only needed for the select widget.
+ * This is to ensure the the user completes all parts of the date not just some
+ * parts. Only needed for the select widget.
  */
 function date_views_select_validate(&$form, &$form_state) {
   // If there are no values just return.
@@ -525,10 +555,10 @@ function date_views_select_validate(&$form, &$form_state) {
 
 /**
  * Implements hook_date_formatter_view_alter().
- *
- * If we are displaying a date from a view, see if we have information about which multiple value to display. If so, set the date_id in the entity.
  */
 function date_views_date_formatter_pre_view_alter(&$entity, &$variables) {
+  // If we are displaying a date from a view, see if we have information about
+  // which multiple value to display. If so, set the date_id in the entity.
   // Some views have no row index.
   if (!empty($entity->view) && isset($entity->view->row_index)) {
     $field = $variables['field'];
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 f226def6..1f710e53 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
@@ -1,7 +1,8 @@
 <?php
+
 /**
  * @file
- * Defines date-related Views data and plugins:
+ * Defines date-related Views data and plugins:.
  *
  * Date argument:
  *   A generic date argument that has an option to select one or more
@@ -126,7 +127,6 @@ function date_views_views_data() {
  * Implements hook_views_data_alter().
  */
 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.
@@ -146,12 +146,12 @@ function date_views_views_data_alter(&$data) {
  *
  * In the SQL date handler.
  *
- * The date handler will use this information to decide if the
- * database value needs a timezone conversion.
+ * The date handler will use this information to decide if the database value
+ * needs a timezone conversion.
  *
- * In Views, we will always be comparing to a local date value,
- * so the goal is to convert the database value to the right
- * value to compare to the local value.
+ * In Views, we will always be comparing to a local date value, so the goal is
+ * to convert the database value to the right value to compare to the local
+ * value.
  */
 function date_views_set_timezone(&$date_handler, &$view, $field) {
   switch ($field['tz_handling']) {
@@ -174,7 +174,6 @@ function date_views_set_timezone(&$date_handler, &$view, $field) {
     default:
       $date_handler->db_timezone = 'UTC';
       $date_handler->local_timezone = date_default_timezone();
-      break;
   }
 }
 
@@ -183,7 +182,6 @@ function date_views_set_timezone(&$date_handler, &$view, $field) {
  *
  * @param object $view
  *   A View object.
- *
  * @param array $extra_params
  *   An extra parameters.
  *
@@ -192,24 +190,29 @@ function date_views_set_timezone(&$date_handler, &$view, $field) {
  */
 function date_views_querystring($view, $extra_params = array()) {
   $query_params = array_merge($_GET, $extra_params);
+
   // Allow NULL params to be removed from the query string.
   foreach ($extra_params as $key => $value) {
     if (!isset($value)) {
       unset($query_params[$key]);
     }
   }
+
   // Filter the special "q" and "view" variables out of the query string.
   $exclude = array('q');
+
   // If we don't explicitly add a value for "view", filter it out.
   if (empty($extra_params['view'])) {
     $exclude[] = 'view';
   }
+
   // Clear out old date pager settings if not explicitly added.
   if (!empty($view->date_info->pager_id) && empty($extra_params[$view->date_info->pager_id])) {
     $exclude[] = $view->date_info->pager_id;
   }
 
   $query = drupal_get_query_parameters($query_params, $exclude);
+
   // To prevent an empty query string from adding a "?" on to the end of a URL,
   // we return NULL.
   return !empty($query) ? $query : NULL;
diff --git a/drupal7/sites/all/modules/date/date_views/includes/date_views_argument_handler.inc b/drupal7/sites/all/modules/date/date_views/includes/date_views_argument_handler.inc
index 20eedff0..cdea1deb 100644
--- a/drupal7/sites/all/modules/date/date_views/includes/date_views_argument_handler.inc
+++ b/drupal7/sites/all/modules/date/date_views/includes/date_views_argument_handler.inc
@@ -1,21 +1,21 @@
 <?php
+
 /**
  * @file
  * Date API views argument handler.
- * This argument combines multiple date arguments into a single argument
- * where all fields are controlled by the same date and can be combined
- * with either AND or OR.
+ *
+ * This argument combines multiple date arguments into a single argument where
+ * all fields are controlled by the same date and can be combined with either
+ * AND or OR.
  */
 
 /**
  * Date API argument handler.
  */
-// @codingStandardsIgnoreStart
 class date_views_argument_handler extends date_views_argument_handler_simple {
 
   /**
-   * Get granularity and use it to create the formula and a format
-   * for the results.
+   * {@inheritdoc}
    */
   function init(&$view, &$options) {
     parent::init($view, $options);
@@ -30,7 +30,7 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
   }
 
   /**
-   * Default value for the date_fields option.
+   * {@inheritdoc}
    */
   function option_definition() {
     $options = parent::option_definition();
@@ -41,7 +41,7 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
   }
 
   /**
-   * Add a form element to select date_fields for this argument.
+   * {@inheritdoc}
    */
   function options_form(&$form, &$form_state) {
     parent::options_form($form, $form_state);
@@ -72,9 +72,12 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
     );
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function options_validate(&$form, &$form_state) {
-
-    // Views will whine if we don't have something for the these values even though we removed the option for summaries.
+    // Views will whine if we don't have something for the these values even
+    // though we removed the option for summaries.
     $form_state['values']['options']['summary']['format'] = 'none';
     $form_state['values']['options']['summary']['options']['none'] = array();
 
@@ -89,6 +92,9 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function options_submit(&$form, &$form_state) {
     // It is very important to call the parent function here:
     parent::options_submit($form, $form_state);
@@ -97,7 +103,9 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
     }
   }
 
-  // Update the summary values to show selected granularity.
+  /**
+   * {@inheritdoc}
+   */
   function admin_summary() {
     $fields = date_views_fields($this->base_table);
     if (!empty($this->options['date_fields'])) {
@@ -115,15 +123,13 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
   }
 
   /**
-   * Provide a list of default behaviors for this argument if the argument
-   * is not present.
-   *
-   * Override this method to provide additional (or fewer) default behaviors.
+   * {@inheritdoc}
    */
   function default_actions($which = NULL) {
     $defaults = parent::default_actions();
 
-    // There is no easy way to do summary queries on multiple fields, so remove that option.
+    // There is no easy way to do summary queries on multiple fields, so remove
+    // that option.
     unset($defaults['summary']);
 
     if ($which) {
@@ -137,14 +143,11 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
   }
 
   /**
-   * Set up the query for this argument.
-   *
-   * The argument sent may be found at $this->argument.
+   * {@inheritdoc}
    */
   function query($group_by = FALSE) {
-
-    // @TODO Not doing anything with $group_by yet, need to figure out what has to be done.
-
+    // @todo Not doing anything with $group_by yet, need to figure out what has
+    // to be done.
     if ($this->date_forbid()) {
       return;
     }
@@ -156,8 +159,8 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
     $this->placeholders = array();
 
     if (!empty($this->query_fields)) {
-      // Use set_where_group() with the selected date_method
-      // of 'AND' or 'OR' to create the where clause.
+      // Use set_where_group() with the selected date_method of 'AND' or 'OR'
+      // to create the where clause.
       foreach ($this->query_fields as $count => $query_field) {
         $field = $query_field['field'];
         $this->date_handler = $query_field['date_handler'];
@@ -168,8 +171,9 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
         if ($field['table_name'] != $this->table || !empty($this->relationship)) {
           $this->table = $this->query->ensure_table($field['table_name'], $this->relationship);
         }
-        // $this->table_alias gets set when the first field is processed if otherwise empty.
-        // For subsequent fields, we need to be sure it is emptied again.
+        // $this->table_alias gets set when the first field is processed if
+        // otherwise empty. For subsequent fields, we need to be sure it is
+        // emptied again.
         elseif (empty($this->relationship)) {
           $this->table_alias = NULL;
         }
@@ -181,7 +185,7 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
   }
 
   /**
-   * Collect information about our fields we will need to create the right query.
+   * {@inheritdoc}
    */
   function get_query_fields() {
     $fields = date_views_fields($this->base_table);
@@ -200,4 +204,3 @@ class date_views_argument_handler extends date_views_argument_handler_simple {
   }
 
 }
-// @codingStandardsIgnoreEnd
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 2839b959..0de4454c 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
@@ -1,19 +1,17 @@
 <?php
+
 /**
  * @file
  * Date API views argument handler.
  */
 
 /**
- * Date API argument handler.
+ * Date API views argument handler.
  */
-// @codingStandardsIgnoreStart
 class date_views_argument_handler_simple extends views_handler_argument_date {
 
   /**
-   * Get granularity.
-   *
-   * Use it to create the formula and a format for the results.
+   * {@inheritdoc}
    */
   function init(&$view, &$options) {
     parent::init($view, $options);
@@ -31,20 +29,19 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
       $this->date_handler->local_timezone = date_get_timezone($field['settings']['tz_handling']);
     }
     $this->date_handler->granularity = $this->options['granularity'];
-    // This value needs to be initialized so
-    // it exists even if the query doesn't run.
+    // This value needs to be initialized so it exists even if the query
+    // doesn't run.
     $this->date_handler->placeholders = array();
 
     $this->format = $this->date_handler->views_formats($this->date_handler->granularity, 'display');
     $this->sql_format = $this->date_handler->views_formats($this->date_handler->granularity, 'sql');
-    // $this->arg_format is the format the parent date
-    // handler will use to create a default argument.
+    // $this->arg_format is the format the parent date handler will use to
+    // create a default argument.
     $this->arg_format = $this->format();
 
-    // Identify the base table for this field.
-    // It will be used to call for the right query field options.
+    // Identify the base table for this field. It will be used to call for the
+    // right query field options.
     $this->base_table = $this->table;
-
   }
 
   /**
@@ -60,9 +57,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
   /**
-   * Set the empty argument value to the current date.
-   *
-   * Formatted appropriately for this argument.
+   * {@inheritdoc}
    */
   function get_default_argument($raw = FALSE) {
     $is_default = FALSE;
@@ -87,9 +82,10 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
   /**
-   * Default value for the date_fields option.
+   * {@inheritdoc}
    */
   function option_definition() {
+    // Default value for the date_fields option.
     $options = parent::option_definition();
     $options['year_range'] = array('default' => '-3:+3');
     $options['granularity'] = array('default' => 'month');
@@ -103,7 +99,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
   /**
-   * Add a form element to select date_fields for this argument.
+   * {@inheritdoc}
    */
   function options_form(&$form, &$form_state) {
     parent::options_form($form, $form_state);
@@ -149,6 +145,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
 
     // Get default granularity options
     $options = $this->date_handler->date_parts();
+
     // Add the 'week' option.
     $options += array(
       'week' => t('Week', array(), array(
@@ -214,7 +211,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
   /**
-   * Provide a link to the next level of the view from the summary.
+   * {@inheritdoc}
    */
   function summary_name($data) {
     $value = $data->{$this->name_alias};
@@ -230,7 +227,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
   /**
-   * Provide a title for the view based on the argument value.
+   * {@inheritdoc}
    */
   function title() {
     $format = !empty($this->options['title_format_custom']) && !empty($this->options['title_format_custom']) ? $this->options['title_format_custom'] : $this->date_handler->views_formats($this->options['granularity'], 'display');
@@ -239,13 +236,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
   /**
-   * Provide the argument to use to link from the summary to the next level.
-   *
-   * This will be called once per row of a summary, and used as part of
-   * $view->get_url().
-   *
-   * @param object $data
-   *   The query results for the row.
+   * {@inheritdoc}
    */
   function summary_argument($data) {
     $format = $this->date_handler->views_formats($this->options['granularity'], 'sql');
@@ -258,24 +249,25 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
   /**
-   * Inject a test for valid date range before the summary query.
+   * {@inheritdoc}
    */
   function summary_query() {
-
-    // @TODO The summary values are computed by the database.
-    // Unless the database has built-in timezone handling it will use
-    // a fixed offset, which will not be right for all dates.
-    // The only way I can see to make this work right is to store the offset
-    // for each date in the database so it can be added to the base
-    // date value before the database formats the result. Because this is a huge
-    // architectural change, it won't go in until we start a new branch.
+    // Inject a test for valid date range before the summary query.
+    // @todo The summary values are computed by the database. Unless the
+    // database has built-in timezone handling it will use a fixed offset,
+    // which will not be right for all dates. The only way I can see to make
+    // this work right is to store the offset for each date in the database so
+    // it can be added to the base date value before the database formats the
+    // result. Because this is a huge architectural change, it won't go in
+    // until we start a new branch.
     $this->formula = $this->date_handler->sql_format($this->sql_format, $this->date_handler->sql_field("***table***.$this->real_field"));
     $this->ensure_my_table();
+
     // Now that our table is secure, get our formula.
     $formula = $this->get_formula();
 
-    // Add the field, give it an alias that does NOT match the actual
-    // field name or grouping won't work right.
+    // Add the field, give it an alias that does NOT match the actual field
+    // name or grouping won't work right.
     $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field . '_summary');
     $this->query->set_count_field(NULL, $formula, $this->field);
 
@@ -283,22 +275,20 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
   /**
-   * Inject a test for valid date range before the regular query.
-   *
-   * Override the parent query to be able to control the $group.
+   * {@inheritdoc}
    */
   function query($group_by = FALSE) {
-
-    // @TODO Not doing anything with $group_by yet,
-    // need to figure out what has to be done.
-
+    // Inject a test for valid date range before the regular query. Override
+    // the parent query to be able to control the $group.
+    // @todo Not doing anything with $group_by yet, need to figure out what has
+    // to be done.
     if ($this->date_forbid()) {
       return;
     }
 
-    // See if we need to reset granularity based on an argument value.
-    // Make sure we don't try to reset to some bogus value if someone has
-    // typed in an unexpected argument.
+    // See if we need to reset granularity based on an argument value. Make
+    // sure we don't try to reset to some bogus value if someone has typed in
+    // an unexpected argument.
     if ($this->options['granularity_reset'] && $granularity = $this->date_handler->arg_granularity($this->argument)) {
       $this->date_handler->granularity = $granularity;
       $this->format = $this->date_handler->views_formats($this->date_handler->granularity, 'display');
@@ -308,8 +298,8 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
     $this->ensure_my_table();
     $group = !empty($this->options['date_group']) ? $this->options['date_group'] : 0;
 
-    // If requested, add the delta field to the view so
-    // we can later find the value that matched our query.
+    // If requested, add the delta field to the view so we can later find the
+    // value that matched our query.
     if (!empty($this->options['add_delta']) && (substr($this->real_field, -6) == '_value' || substr($this->real_field, -7) == '_value2')) {
       $this->query->add_field($this->table_alias, 'delta');
       $real_field_name = str_replace(array('_value', '_value2'), '', $this->real_field);
@@ -324,10 +314,9 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
     $view_max_placeholder = $this->placeholder();
     $this->date_handler->placeholders = array($view_min_placeholder => $view_min, $view_max_placeholder => $view_max);
 
-    // Are we comparing this field only or the Start/End date range
-    // to the view criteria?
+    // Are we comparing this field only or the Start/End date range to the view
+    // criteria?
     if (!empty($this->options['use_fromto'])) {
-
       // The simple case, match the field to the view range.
       $field = $this->date_handler->sql_field($this->table_alias . '.' . $this->real_field, NULL, $this->min_date);
       $field = $this->date_handler->sql_format($format, $field);
@@ -335,15 +324,12 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
 
     }
     else {
-
-      // Look for the intersection of the range
-      // of the date field with the range of the view.
-      // Get the Start/End values for this field.
-      // Retrieve using the original table name.
-      // Swap the current table name (adjusted for relationships)
-      // into the query.
-      // @TODO We may be able to use Views substitutions here,
-      // investigate that later.
+      // Look for the intersection of the range of the date field with the
+      // range of the view. Get the Start/End values for this field. Retrieve
+      // using the original table name. Swap the current table name (adjusted
+      // for relationships) into the query.
+      // @todo We may be able to use Views substitutions here, investigate that
+      // later.
       $fields = date_views_fields($this->base_table);
       $fields = $fields['name'];
       $fromto = $fields[$this->original_table . '.' . $this->real_field]['fromto'];
@@ -361,8 +347,8 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   /**
    * Add a callback.
    *
-   * To determine if we have moved outside
-   * the valid date range for this argument.
+   * To determine if we have moved outside the valid date range for this
+   * argument.
    */
   function date_forbid() {
     if (empty($this->argument)) {
@@ -384,4 +370,3 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
   }
 
 }
-// @codingStandardsIgnoreEnd
diff --git a/drupal7/sites/all/modules/date/date_views/includes/date_views_fields.inc b/drupal7/sites/all/modules/date/date_views/includes/date_views_fields.inc
index d497ef60..b8aad154 100644
--- a/drupal7/sites/all/modules/date/date_views/includes/date_views_fields.inc
+++ b/drupal7/sites/all/modules/date/date_views/includes/date_views_fields.inc
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Helper for identifying Date API fields for views.
@@ -9,10 +10,10 @@
  *
  * @return array
  *   An array with fieldname, type, and table.
+ *
  * @see date_views_date_views_fields()
  */
 function _date_views_fields($base = 'node') {
-
   // Make sure $base is never empty.
   if (empty($base)) {
     $base = 'node';
@@ -83,14 +84,14 @@ function _date_views_fields($base = 'node') {
 
         default:
           // If this is not a date field, nothing more to do.
-          continue;
+          continue 2;
       }
 
       $revision = in_array($base, array('node_revision')) ? FIELD_LOAD_REVISION : FIELD_LOAD_CURRENT;
       $db_info = date_api_database_info($field, $revision);
       $name = $table_name . "." . $field_name;
       $grans = array('year', 'month', 'day', 'hour', 'minute', 'second');
-      $granularity = !empty($field['granularity']) ? $field['granularity'] : $grans;
+      $granularity = !empty($field['settings']['granularity']) ? $field['settings']['granularity'] : $grans;
 
       $fromto = array(
         $table_name . '.' . $db_info['columns'][$table_name]['value'],
@@ -104,7 +105,7 @@ function _date_views_fields($base = 'node') {
           $offset_field = $table_name . '.' . $db_info['columns'][$table_name]['offset'];
         }
         $related_fields = array(
-          $table_name . '.' . $db_info['columns'][$table_name]['value']
+          $table_name . '.' . $db_info['columns'][$table_name]['value'],
         );
         if (isset($db_info['columns'][$table_name]['value2'])) {
           $related_fields = array_merge($related_fields, array($table_name . '.' . $db_info['columns'][$table_name]['value2']));
diff --git a/drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc b/drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc
index ae6944ee..5ed0847b 100644
--- a/drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc
+++ b/drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc
@@ -1,14 +1,22 @@
 <?php
+
 /**
  * @file
  * A flexible, configurable date filter.
- * This filter combines multiple date filters into a single filter
- * where all fields are controlled by the same date and can be combined
- * with either AND or OR.
  */
 
-// @codingStandardsIgnoreStart
+/**
+ * A flexible, configurable date filter.
+ *
+ * This filter combines multiple date filters into a single filter where all
+ * fields are controlled by the same date and can be combined with either AND or
+ * OR.
+ */
 class date_views_filter_handler extends date_views_filter_handler_simple {
+
+  /**
+   * {@inheritdoc}
+   */
   function init(&$view, &$options) {
     parent::init($view, $options);
 
@@ -21,7 +29,9 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
     $this->view->date_info->date_fields = array_merge($this->view->date_info->date_fields, $this->options['date_fields']);
   }
 
-  // Set default values for the date filter.
+  /**
+   * {@inheritdoc}
+   */
   function option_definition() {
     $options = parent::option_definition();
     $options['date_fields'] = array('default' => array());
@@ -30,18 +40,30 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
     return $options;
   }
 
+  /**
+   * @todo
+   */
   function op_between($field) {
     $this->date_combine_conditions('op_between');
   }
 
+  /**
+   * @todo
+   */
   function op_simple($field) {
     $this->date_combine_conditions('op_simple');
   }
 
+  /**
+   * @todo
+   */
   function op_contains($field) {
     $this->date_combine_conditions('op_contains');
   }
 
+  /**
+   * @todo
+   */
   function op_empty($field) {
     $this->get_query_fields();
     if (empty($this->query_fields)) {
@@ -83,6 +105,7 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
 
     // Create a custom filter group for the conditions.
     $this->query->set_where_group($this->options['date_method'], $this->options['date_group']);
+
     // Add each condition to the custom filter group.
     foreach ((array) $this->query_fields as $query_field) {
       $field = $query_field['field'];
@@ -120,6 +143,9 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
     $this->query->add_where_expression($this->options['group'], $conditions, $placeholders);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function extra_options_form(&$form, &$form_state) {
     parent::extra_options_form($form, $form_state);
 
@@ -147,6 +173,9 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
       );
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function extra_options_validate($form, &$form_state) {
     $check_fields = array_filter($form_state['values']['options']['date_fields']);
     if (empty($check_fields)) {
@@ -154,12 +183,16 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function extra_options_submit($form, &$form_state) {
     $form_state['values']['options']['date_fields'] = array_filter($form_state['values']['options']['date_fields']);
   }
 
-  // Update the summary values to provide
-  // meaningful information for each option.
+  /**
+   * {@inheritdoc}
+   */
   function admin_summary() {
     if (empty($this->options['date_fields'])) {
       return t('Missing date fields!');
@@ -195,6 +228,9 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
     return $output;
   }
 
+  /**
+   * @todo
+   */
   function get_query_fields() {
     $fields = date_views_fields($this->base_table);
     $fields = $fields['name'];
@@ -209,5 +245,5 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
       }
     }
   }
+
 }
-// @codingStandardsIgnoreEnd
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 4fa4c409..d19dc2d4 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
@@ -1,15 +1,28 @@
 <?php
+
 /**
  * @file
- * A standard Views filter for a single date field,
- * using Date API form selectors and sql handling.
+ * A standard Views filter for a single date field.
  */
 
-// @codingStandardsIgnoreStart
+/**
+ * A standard Views filter for a single date field.
+ */
 class date_views_filter_handler_simple extends views_handler_filter_date {
-  var $date_handler = NULL;
-  var $offset = NULL;
 
+  /**
+   * @var object
+   */
+  public $date_handler = NULL;
+
+  /**
+   * @var int
+   */
+  public $offset = NULL;
+
+  /**
+   * {@inheritdoc}
+   */
   function init(&$view, &$options) {
     parent::init($view, $options);
     module_load_include('inc', 'date_api', 'date_api_sql');
@@ -26,13 +39,14 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     $this->date_handler->granularity = isset($options['granularity']) ? $options['granularity'] : 'day';
     $this->format = $this->date_handler->views_formats($this->options['granularity'], 'sql');
 
-    // Identify the base table for this field.
-    // It will be used to call for the right query field options.
+    // Identify the base table for this field. It will be used to call for the
+    // right query field options.
     $this->base_table = $this->table;
-
   }
 
-  // Set default values for the date filter.
+  /**
+   * {@inheritdoc}
+   */
   function option_definition() {
     $options = parent::option_definition();
     $options['granularity'] = array('default' => 'day');
@@ -44,14 +58,24 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     return $options;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function operators() {
+    // Cache the operators that are being added.
+    static $new_operators;
+    if (!isset($new_operators)) {
+      $new_operators = array(
+        'title' => t('Contains'),
+        'method' => 'op_contains',
+        'short' => t('contains'),
+        'values' => 1,
+      );
+    }
+
+    // Add the new 'contains' operators.
     $operators = parent::operators();
-    $operators['contains'] = array(
-      'title' => t('Contains'),
-      'method' => 'op_contains',
-      'short' => t('contains'),
-      'values' => 1,
-    );
+    $operators['contains'] = $new_operators;
     return $operators;
   }
 
@@ -91,9 +115,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
   /**
    * Helper function to see if we need to swap in the default value.
    *
-   * Views exposed filters treat everything as submitted, so if it's an empty value we have to
-   * see if anything actually was submitted. If nothing has really been submitted, we need
-   * to swap in our default value logic.
+   * Views exposed filters treat everything as submitted, so if it's an empty
+   * value we have to see if anything actually was submitted. If nothing has
+   * really been submitted, we need to swap in our default value logic.
    */
   function get_filter_value($prefix, $input) {
     // All our date widgets provide datetime values but we use ISO in our SQL
@@ -111,6 +135,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     return str_replace(' ', 'T', $input);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function accept_exposed_input($input) {
     if (!empty($this->options['exposed'])) {
       $element_input = $input[$this->options['expose']['identifier']];
@@ -127,12 +154,14 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
       $input[$this->options['expose']['identifier']] = $element_input;
     }
     return parent::accept_exposed_input($input);
-
   }
 
+  /**
+   * @todo
+   */
   function op_between($field) {
-
-    // Add the delta field to the view so we can later find the value that matched our query.
+    // Add the delta field to the view so we can later find the value that
+    // matched our query.
     list($table_name, $field_name) = explode('.', $field);
     if (!empty($this->options['add_delta']) && (substr($field_name, -6) == '_value' || substr($field_name, -7) == '_value2')) {
       $this->query->add_field($table_name, 'delta');
@@ -160,9 +189,12 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     }
   }
 
+  /**
+   * @todo
+   */
   function op_simple($field) {
-
-    // Add the delta field to the view so we can later find the value that matched our query.
+    // Add the delta field to the view so we can later find the value that
+    // matched our query.
     list($table_name, $field_name) = explode('.', $field);
     if (!empty($this->options['add_delta']) && (substr($field_name, -6) == '_value' || substr($field_name, -7) == '_value2')) {
       $this->query->add_field($table_name, 'delta');
@@ -180,9 +212,12 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     $this->query->add_where_expression($group, "$field $this->operator $placeholder", array($placeholder => $value));
   }
 
+  /**
+   * @todo
+   */
   function op_contains($field) {
-
-    // Add the delta field to the view so we can later find the value that matched our query.
+    // Add the delta field to the view so we can later find the value that
+    // matched our query.
     list($table_name, $field_name) = explode('.', $field);
     if (!empty($this->options['add_delta']) && (substr($field_name, -6) == '_value' || substr($field_name, -7) == '_value2')) {
       $this->query->add_field($table_name, 'delta');
@@ -204,12 +239,14 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
   }
 
   /**
-   * Set the granularity of the date parts to use in the filter.
-    */
-  function has_extra_options() { return TRUE; }
+   * {@inheritdoc}
+   */
+  function has_extra_options() {
+    return TRUE;
+  }
 
   /**
-   * Date selection options.
+   * {@inheritdoc}
    */
   function widget_options() {
     $options = array(
@@ -223,6 +260,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     return $options;
   }
 
+  /**
+   * @todo
+   */
   function year_range() {
     $year_range = explode(':', $this->options['year_range']);
     if (substr($this->options['year_range'], 0, 1) == '-' || $year_range[0] < 0) {
@@ -233,6 +273,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     return $year_range;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function extra_options_form(&$form, &$form_state) {
     parent::extra_options_form($form, $form_state);
     $form['form_type'] = array(
@@ -264,6 +307,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     );
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function extra_options_validate($form, &$form_state) {
     if (!preg_match('/^(?:[\+\-][0-9]{1,4}|[0-9]{4}):(?:[\+\-][0-9]{1,4}|[0-9]{4})$/', $form_state['values']['options']['year_range'])) {
       form_error($form['year_range'], t('Date year range must be in the format -9:+9, 2005:2010, -9:2010, or 2005:+9'));
@@ -271,13 +317,18 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
   }
 
   /**
-   * Add the selectors to the value form using the date handler.
+   * {@inheritdoc}
    */
   function value_form(&$form, &$form_state) {
-    // We use different values than the parent form, so we must
-    // construct our own form element.
+    // We use different values than the parent form, so we must construct our
+    // own form element.
     $form['value'] = array();
     $form['value']['#tree'] = TRUE;
+    $form['value']['#id'] = 'date_views_exposed_filter-' . bin2hex(drupal_random_bytes(16));
+    $form['value']['#type'] = 'container';
+    if (module_exists('ctools')) {
+      $form['value']['#pre_render'] = array('ctools_dependent_pre_render');
+    }
 
     // Below section copied from views_handler_filter_numeric.inc.
     $which = 'all';
@@ -288,9 +339,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
 
     $identifier = $this->options['expose']['identifier'];
     if (!empty($form_state['exposed'])) {
-
       if (empty($this->options['expose']['use_operator']) || empty($this->options['expose']['operator_id'])) {
-        // exposed and locked.
+        // Exposed and locked.
         $which = in_array($this->operator, $this->operator_values(2)) ? 'minmax' : 'value';
       }
       else {
@@ -307,8 +357,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
       $form['value'] += $this->date_parts_form($form_state, 'max', $source, $which, $this->operator_values(2), $identifier, 'default_to_date');
     }
 
-    // Add some extra validation for the select widget to be sure that
-    // the user inputs all parts of the date.
+    // Add some extra validation for the select widget to be sure that the user
+    // inputs all parts of the date.
     if ($this->options['form_type'] == 'date_select') {
       $form['value']['#element_validate'] = array('date_views_select_validate');
     }
@@ -341,14 +391,15 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
         $label = t('Start date');
         $relative_label = t('Relative start date');
         break;
+
       case 'max':
         $label = t('End date');
         $relative_label = t('Relative end date');
         break;
+
       default:
         $label = '';
         $relative_label = t('Relative date');
-        break;
     }
 
     $type = $this->options['form_type'];
@@ -362,10 +413,12 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
 
     if (!empty($form_state['exposed'])) {
       // UI when the date selector is exposed.
+      $label = $this->options['expose']['label'];
       $default_date = $this->date_default_value($prefix);
       $id = 'edit-' . str_replace('_', '-', $this->field) . '-' . $prefix;
       $form[$prefix] = array(
         '#title' => check_plain($label),
+        '#title_display' => 'invisible',
         '#type' => $type,
         '#size' => 20,
         '#default_value' => !empty($this->value[$prefix]) ? $this->value[$prefix] : $default_date,
@@ -380,7 +433,16 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
         $form[$prefix]['#pre_render'][] = 'ctools_dependent_pre_render';
         $form[$prefix]['#dependency'] = array($source => $operator_values);
       }
+
+      // Validate the input value; set form state input array.
+      $input = isset($form_state['input'][$identifier][$prefix]) ? $form_state['input'][$identifier][$prefix] : array();
+      $form_state['input'][$identifier][$prefix] = $this->input_validate($form[$prefix], $input);
+
       if (!isset($form_state['input'][$identifier][$prefix])) {
+        // Handle bogus input from the query string to prevent fatal errors.
+        if (isset($form_state['input'][$identifier]) && !is_array($form_state['input'][$identifier])) {
+          $form_state['input'][$identifier] = array();
+        }
         // Ensure these exist.
         foreach ($granularity as $key) {
           $form_state['input'][$identifier][$prefix][$key] = NULL;
@@ -438,18 +500,67 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     return $form;
   }
 
+  /**
+   * Returns form state input array appropriate to missing, valid, and invalid input.
+   */
+  function input_validate($element, $input) {
+    if (!$input) {
+      // No input value (e.g. initial form load), set value to NULL so Form API
+      // calls the element value_callback routine with FALSE to set the '#value'
+      // property from the '#default_value' property.
+      // See _form_builder_handle_input_element().
+      if ($element['#type'] != 'date_select') {
+        return array('date' => NULL);
+      }
+      $granularity = date_format_order($element['#date_format']);
+      if ($key = array_search('timezone', $granularity)) {
+        unset($granularity[$key]);
+      }
+      return array_fill_keys($granularity, NULL);
+    }
+
+    // Include element defaults to avoid notices in the xxx_input_date routines.
+    // Copied from form_builder() in form.inc.
+    if (isset($element['#type']) && empty($element['#defaults_loaded']) && ($info = element_info($element['#type']))) {
+      // Overlay $info onto $element, retaining preexisting keys in $element.
+      $element += $info;
+      $element['#defaults_loaded'] = TRUE;
+    }
+
+    $date = NULL;
+    $function = "{$element['#type']}_input_date";
+    if (($date = $function($element, $input)) && date_is_date($date)) {
+      // The input is valid including being in the expected format.
+      return $input;
+    }
+
+    if (is_object($date)) {
+      // Input may not meet the granularity and format but is recognizable.
+      return $input;
+    }
+
+    // Input is bogus, return empty array in granularity format.
+    if ($element['#type'] != 'date_select') {
+      return array('date' => '');
+    }
+
+    $granularity = date_format_order($element['#date_format']);
+    if ($key = array_search('timezone', $granularity)) {
+      unset($granularity[$key]);
+    }
+    return array_fill_keys($granularity, '');
+  }
+
   /**
    * Value validation.
    *
-   * TODO add in more validation.
+   * @todo Add in more validation.
    *
-   * We are setting an extra option using a value form
-   * because it makes more sense to set it there.
-   * That's not the normal method, so we have to manually
+   * We are setting an extra option using a value form because it makes more
+   * sense to set it there. That's not the normal method, so we have to manually
    * transfer the selected value back to the option.
    */
   function value_validate($form, &$form_state) {
-
     $options = &$form_state['values']['options'];
 
     if ($options['operator'] == 'between' || $options['operator'] == 'not between') {
@@ -459,7 +570,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
         }
         else {
           $this->options['default_date'] = $options['value']['min_group']['default_date'];
-          // NULL out the value field, user wanted the relative value to take hold.
+          // NULL out the value field, user wanted the relative value to take
+          // hold.
           $options['value']['min_group']['min'] = NULL;
         }
       }
@@ -473,7 +585,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
         }
         else {
           $this->options['default_to_date'] = $options['value']['max_group']['default_to_date'];
-          // NULL out the value field, user wanted the relative value to take hold.
+          // NULL out the value field, user wanted the relative value to take
+          // hold.
           $options['value']['max_group']['max'] = NULL;
         }
       }
@@ -489,7 +602,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
         }
         else {
           $this->options['default_date'] = $options['value']['value_group']['default_date'];
-          // NULL out the value field, user wanted the relative value to take hold.
+          // NULL out the value field, user wanted the relative value to take
+          // hold.
           $options['value']['value_group']['value'] = NULL;
         }
       }
@@ -512,8 +626,9 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
     // Our date widgets do their own validation.
   }
 
-  // Update the summary values to provide
-  // meaningful information for each option.
+  /**
+   * {@inheritdoc}
+   */
   function admin_summary() {
     $parts = $this->date_handler->date_parts();
     $widget_options = $this->widget_options();
@@ -535,4 +650,3 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
   }
 
 }
-// @codingStandardsIgnoreEnd
diff --git a/drupal7/sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc b/drupal7/sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc
index 1addd200..7cdab30a 100644
--- a/drupal7/sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc
+++ b/drupal7/sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc
@@ -1,100 +1,88 @@
 <?php
+
 /**
  * @file
  * Date pager.
- * Works with a Date argument, the argument filters
- * the view and the pager provides back/next navigation.
+ *
+ * Works with a Date argument, the argument filters the view and the pager
+ * provides back/next navigation.
  *
  * USER NOTES:
  *
  * To use this, add a pager to a view, and choose the option to 'Page by date'.
  * There are several settings:
- * - The pager id: Set an id to be used as the identifier
- *    in the url for pager values, defaults to 'date'.
- * - Pager position: Choose whether to display the date
- *    pager above, below, or both above and below the content.
- * - Link format: Choose whether the pager links will be in t
- *    he simple 'calendar/2011-12' format or the
- *    more complex 'calendar/?date=2011-12' pager format.
- *    The second one is more likely to work correctly
- *    if the pager is used in blocks and panels.
+ * - The pager id: Set an id to be used as the identifier in the URL for pager
+ *   values, defaults to 'date'.
+ * - Pager position: Choose whether to display the date pager above, below, or
+ *   both above and below the content.
+ * - Link format: Choose whether the pager links will be in the simple
+ *   'calendar/2011-12' format or the more complex 'calendar/?date=2011-12'
+ *   pager format. The second one is more likely to work correctly if the pager
+ *   is used in blocks and panels.
  *
- * The pager works in combination with a Date argument
- * and it will use the date fields and granularity
- * set in that argument to create its back/next links.
- * If the view has no Date argument, the pager can
- * do nothing. The argument can either be a 'Date' argument
- * that lets you select one or more date fields
- * in the argument, or the simple 'Content' argument for an
- * individual date field. It must be an
- * argument that uses the date argument handler.
+ * The pager works in combination with a Date argument and it will use the date
+ * fields and granularity set in that argument to create its back/next links. If
+ * the view has no Date argument, the pager can do nothing. The argument can
+ * either be a 'Date' argument that lets you select one or more date fields in
+ * the argument, or the simple 'Content' argument for an individual date field.
+ * It must be an argument that uses the date argument handler.
  *
  * DEVELOPER NOTES
  *
- * The pager could technically create a query of its own rather
- * than depending on the date argument to
- * set the query, but it has only a limited set of tools to work
- * with because it is a plugin, not a handler:
- * it has no knowledge about relationships, it cannot use the
- * ensure_my_table() function, plugins are not even invoked in pre_query(),
- * so can't do anything there.
+ * The pager could technically create a query of its own rather than depending
+ * on the date argument to set the query, but it has only a limited set of tools
+ * to work with because it is a plugin, not a handler: it has no knowledge about
+ * relationships, it cannot use the ensure_my_table() function, plugins are not
+ * even invoked in pre_query(), so can't do anything there.
  *
- * My conclusion was that the date pager simply
- * is not powerful enough to create its own queries for
- * date fields, which require very complex queries.
- * Instead, we can combine this with a date argument and
- * let the argument create the query and let the pager
- * just provide the back/next links. If there is no
- * date argument, the pager will do nothing.
+ * My conclusion was that the date pager simply is not powerful enough to create
+ * its own queries for date fields, which require very complex queries. Instead,
+ * we can combine this with a date argument and let the argument create the
+ * query and let the pager just provide the back/next links. If there is no date
+ * argument, the pager will do nothing.
  *
- * There are still other problems. The pager is not even
- * initialized until after all the handlers
- * have created their queries, so it has no chance
- * to alter values ahead of that. And the argument
- * has no knowledge of the pager, so it can't check
- * for pager values before the query is created.
+ * There are still other problems. The pager is not even initialized until after
+ * all the handlers have created their queries, so it has no chance to alter
+ * values ahead of that. And the argument has no knowledge of the pager, so it
+ * can't check for pager values before the query is created.
  *
- * The solution used here is to let the argument create
- * the original query. The pager query
- * runs after that, so the pager checks to see
- * if there is a pager value that needs to be used in the query.
- * The date argument has identified the placeholders
- * it used in the query. So if a change is needed,
- * we can swap the pager value into the query created
- * by the date argument and adjust the
- * $view->date_info values set by the argument accordingly
- * so the theme will pick up the new information.
+ * The solution used here is to let the argument create the original query. The
+ * pager query runs after that, so the pager checks to see if there is a pager
+ * value that needs to be used in the query. The date argument has identified
+ * the placeholders it used in the query. So if a change is needed, we can swap
+ * the pager value into the query created by the date argument and adjust the
+ * $view->date_info values set by the argument accordingly so the theme will
+ * pick up the new information.
  */
 
 /**
- * Example plugin to handle paging by month.
+ * Views pager plugin to page by month.
  */
-// @codingStandardsIgnoreStart
 class date_views_plugin_pager extends views_plugin_pager {
 
   /**
-   * This kind of pager does not need to count the number of records.
+   * {@inheritdoc}
    */
   function use_count_query() {
     return FALSE;
   }
 
   /**
-   * Because we don't know how many pages there are, we never believe there are more records.
+   * {@inheritdoc}
    */
   function has_more_records() {
     return FALSE;
   }
 
-  /*
-   * Tell Views what this pager's setting is.
+  /**
+   * {@inheritdoc}
    */
   function summary_title() {
     return t("Position: @position, format: @format.", array('@position' => $this->options['pager_position'], '@format' => $this->options['link_format']));
   }
 
   /**
-   * Tell Views what options this plugin can store.
+   * {@inheritdoc}
    */
   function option_definition() {
     $options = parent::option_definition();
@@ -107,8 +95,8 @@ class date_views_plugin_pager extends views_plugin_pager {
     return $options;
   }
 
-  /*
-   * Provide the form for setting options.
+  /**
+   * {@inheritdoc}
    */
   function options_form(&$form, &$form_state) {
     $form['markup']['#markup'] = t('This pager works together with a Date or Content date field contextual filter. If a Date filter has been added to the view, this pager will provide back/next paging to match the granularity of that filter (i.e. paging by year, month, week, or day). The filter must also be configured to use a DATE default value. If there is no Date contextual filter on this view, or if it has not been set to use a default date, the pager will not appear.');
@@ -148,13 +136,11 @@ class date_views_plugin_pager extends views_plugin_pager {
   }
 
   /**
-   * Transfer date information from the argument to the view so the pager theme can use it
-   * and update the date argument value to whatever is set by the pager.
+   * {@inheritdoc}
    */
   function query() {
-
-    // By fetching our data from the exposed input, it is possible to
-    // feed pager data through some method other than $_GET.
+    // By fetching our data from the exposed input, it is possible to feed
+    // pager data through some method other than $_GET.
     $input = $this->view->get_exposed_input();
     $value = NULL;
     if (!empty($input) && !empty($input[$this->options['date_id']])) {
@@ -166,15 +152,15 @@ class date_views_plugin_pager extends views_plugin_pager {
     foreach ($this->view->argument as $id => &$argument) {
       if (date_views_handler_is_date($argument, 'argument')) {
 
-        // If the argument is empty, nothing to do. This could be from
-        // an argument that does not set a default value.
+        // If the argument is empty, nothing to do. This could be from an
+        // argument that does not set a default value.
         if (empty($argument->argument) || empty($argument->date_handler)) {
           continue;
         }
 
-        // Storing this information in the pager so it's available for summary info.
-        // The view argument information is not otherwise accessible to the pager.
-        // Not working right yet, tho.
+        // Storing this information in the pager so it's available for summary
+        // info. The view argument information is not otherwise accessible to
+        // the pager. Not working right yet, tho.
         $date_handler = $argument->date_handler;
         $this->options['date_argument'] = $id;
         $this->options['granularity'] = $argument->date_handler->granularity;
@@ -189,8 +175,9 @@ class date_views_plugin_pager extends views_plugin_pager {
           $this->view->build_info['fail'] = TRUE;
           return;
         }
-        // Write date_info to store information to be used
-        // in the theming functions.
+
+        // Write date_info to store information to be used in the theming
+        // functions.
         if (empty($this->view->date_info)) {
           $this->view->date_info = new stdClass();
         }
@@ -205,8 +192,9 @@ class date_views_plugin_pager extends views_plugin_pager {
         $this->view->date_info->date_pager_position = $this->options['pager_position'];
         $this->view->date_info->date_pager_format = $this->options['link_format'];
         $this->view->date_info->skip_empty_pages = $this->options['skip_empty_pages'] == 1;
-        // Execute two additional queries to find
-        // the previous and next page with values.
+
+        // Execute two additional queries to find the previous and next page
+        // with values.
         if ($this->view->date_info->skip_empty_pages) {
           $q = clone $argument->query;
           $field = $argument->table_alias . '.' . $argument->real_field;
@@ -217,8 +205,8 @@ class date_views_plugin_pager extends views_plugin_pager {
           $q->set_distinct(TRUE, TRUE);
           // Date limits of this argument.
           $datelimits = $argument->date_handler->arg_range($argument->limit[0] . '--' . $argument->limit[1]);
-          // Find the first two dates between the minimum date
-          // and the upper bound of the current value.
+          // Find the first two dates between the minimum date and the upper
+          // bound of the current value.
           $q->add_orderby(NULL, $fieldsql, 'DESC', 'date');
           $this->set_argument_placeholders($this->view->date_info->placeholders, $datelimits[0], $argument->max_date, $q, $format);
 
@@ -243,7 +231,7 @@ class date_views_plugin_pager extends views_plugin_pager {
           // Set the default value of the query to $prevfirst or $nextfirst
           // when there is no value and $prevsecond or $nextsecond is set.
           if (empty($value)) {
-            // @Todo find out which of $prevdate or $nextdate is closest to the
+            // @todo find out which of $prevdate or $nextdate is closest to the
             // default argument date value and choose that one.
             if ($prevdate && $prevdatealt) {
               $this->set_argument_value($argument, $prevdate);
@@ -269,8 +257,8 @@ class date_views_plugin_pager extends views_plugin_pager {
             }
           }
           else {
-            // $prevdate and $nextdate are the same as $value, so move to
-            // the next values.
+            // $prevdate and $nextdate are the same as $value, so move to the
+            // next values.
             $prevdate = $prevdatealt;
             $nextdate = $nextdatealt;
           }
@@ -279,9 +267,9 @@ class date_views_plugin_pager extends views_plugin_pager {
           $this->view->date_info->next_date = $nextdate ? new DateObject($nextdate, NULL, $format) : NULL;
         }
         else {
-          $this->view->date_info->prev_date = clone($argument->min_date);
+          $this->view->date_info->prev_date = clone $argument->min_date;
           date_modify($this->view->date_info->prev_date, '-1 ' . $argument->date_handler->granularity);
-          $this->view->date_info->next_date = clone($argument->min_date);
+          $this->view->date_info->next_date = clone $argument->min_date;
           date_modify($this->view->date_info->next_date, '+1 ' . $argument->date_handler->granularity);
         }
         // Write the date_info properties that depend on the current value.
@@ -296,14 +284,17 @@ class date_views_plugin_pager extends views_plugin_pager {
       $i++;
     }
 
-    // Is this a view that needs to be altered based on a pager value?
-    // If there is pager input and the argument has set the placeholders,
-    // swap the pager value in for the placeholder set by the argument.
+    // Is this a view that needs to be altered based on a pager value? If there
+    // is pager input and the argument has set the placeholders, swap the pager
+    // value in for the placeholder set by the argument.
     if (!empty($value) && !empty($this->view->date_info->placeholders)) {
       $this->set_argument_placeholders($this->view->date_info->placeholders, $this->view->date_info->min_date, $this->view->date_info->max_date, $this->view->query, $format);
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function set_argument_value($argument, $value) {
     $argument->argument = $value;
     $argument->date_range = $argument->date_handler->arg_range($value);
@@ -314,6 +305,9 @@ class date_views_plugin_pager extends views_plugin_pager {
     $argument->is_default = FALSE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function set_argument_placeholders($placeholders, $mindate, $maxdate, $query, $format) {
     $count = count($placeholders);
     foreach ($query->where as $group => $data) {
@@ -321,8 +315,8 @@ class date_views_plugin_pager extends views_plugin_pager {
         if (array_key_exists('value', $condition) && is_array($condition['value'])) {
           foreach ($condition['value'] as $placeholder => $placeholder_value) {
             if (array_key_exists($placeholder, $placeholders)) {
-              // If we didn't get a match, this is a > $min < $max query that uses the view
-              // min and max dates as placeholders.
+              // If we didn't get a match, this is a > $min < $max query that
+              // uses the view min and max dates as placeholders.
               $date = ($count == 2) ? $mindate : $maxdate;
               $next_placeholder = array_shift($placeholders);
               $query->where[$group]['conditions'][$delta]['value'][$placeholder] = $date->format($format);
@@ -335,7 +329,7 @@ class date_views_plugin_pager extends views_plugin_pager {
   }
 
   /**
-   * Add a callback to determine if we have moved outside the valid date range for this argument.
+   * Determine if we have moved outside the valid date range for this argument.
    */
   function date_forbid($argument) {
     // See if we're outside the allowed date range for our argument.
@@ -346,11 +340,22 @@ class date_views_plugin_pager extends views_plugin_pager {
     return FALSE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  function pre_render(&$result) {
+    // Load theme functions for the pager.
+    module_load_include('inc', 'date_views', 'theme/theme');
+  }
 
+  /**
+   * {@inheritdoc}
+   */
   function render($input) {
-    // This adds all of our template suggestions based upon the view name and display id.
+    // This adds all of our template suggestions based upon the view name and
+    // display id.
     $pager_theme = views_theme_functions('date_views_pager', $this->view, $this->display);
     return theme($pager_theme, array('plugin' => $this, 'input' => $input));
   }
+
 }
-// @codingStandardsIgnoreEnd
diff --git a/drupal7/sites/all/modules/date/date_views/tests/date_views_filter.test b/drupal7/sites/all/modules/date/date_views/tests/date_views_filter.test
new file mode 100644
index 00000000..70d163e3
--- /dev/null
+++ b/drupal7/sites/all/modules/date/date_views/tests/date_views_filter.test
@@ -0,0 +1,515 @@
+<?php
+
+/**
+ * @file
+ * Tests date filter handler in Views.
+ */
+
+class DateViewsFilterTestCase extends DateFieldTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'Date Views - Filter Test',
+      'description' => 'Tests date filter handler in Views, including Date Popup fields.',
+      'group' => 'Date Views',
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp(array $modules = array()) {
+    $modules[] = 'views_ui';
+    $modules[] = 'date_views';
+    $modules[] = 'date_popup';
+    parent::setUp($modules);
+
+    // Initialize values.
+    $this->initialize();
+
+    // Reset/rebuild all data structures after enabling the modules.
+    $this->resetAll();
+
+    // Create a date field.
+    $this->createDateField();
+
+    // Create sample nodes.
+    $this->createDateContent();
+  }
+
+  /**
+   * Initialize test values.
+   */
+  public function initialize() {
+    $this->config_url = 'admin/structure/views/nojs/config-item/test_date_filters/default/filter';
+    $this->extra_url = 'admin/structure/views/nojs/config-item-extra/test_date_filters/default/filter';
+
+    // This is used in views configuration and on the view page.
+    variable_set('date_format_short', 'Y-m-d H:i');
+
+    if ($this->privileged_user) {
+      // Add required permissions.
+      $roles = $this->privileged_user->roles;
+      unset($roles[2]);
+      $rid = key($roles);
+      $permissions = array('administer views'/*, 'administer site configuration'*/);
+      user_role_grant_permissions($rid, $permissions);
+    }
+  }
+
+  /**
+   * Adds a date field to a node bundle.
+   */
+  public function createDateField($values = array()) {
+    // Create a date field.
+    $values = array(
+      'label' => 'Sample date',
+      'widget_type' => 'date_select',
+      'field_name' => 'sample_date',
+      'field_type' => 'datetime',
+      'input_format' => 'm/d/Y - H:i:s',
+      'granularity' => array('year', 'month', 'day'),
+    );
+    parent::createDateField($values);
+  }
+
+  /**
+   * Saves content with a date field.
+   */
+  public function createDateContent() {
+    $years = range(date('Y') - 3, date('Y') + 3);
+    foreach ($years as $year) {
+      for($month = 1; $month < 13; $month++) {
+        $node = array(
+          'type' => 'story',
+          'title' => "Story from $year-$month-01",
+          'uid' => '1',
+        );
+        $node['sample_date']['und'][0]['value'] = "$year-$month-01";
+        node_save((object) $node);
+      }
+    }
+  }
+
+  /**
+   * Creates a view with a date filter for each date widget type.
+   */
+  public function createDateFilterView() {
+    if ($view = views_get_view('test_date_filters')) {
+      // Delete view, then recreate it in a known state.
+      views_delete_view($view);
+    }
+
+    // Create the view.
+    $view = new view();
+    $view->name = 'test_date_filters';
+    $view->description = '';
+    $view->tag = 'default';
+    $view->base_table = 'node';
+    $view->human_name = 'Test date filters';
+    $view->core = 7;
+    $view->api_version = '3.0';
+    $view->disabled = FALSE;
+
+    /* Display: Master */
+    $handler = $view->new_display('default', 'Master', 'default');
+    $handler->display->display_options['title'] = 'Date filters';
+    $handler->display->display_options['use_more_always'] = FALSE;
+    $handler->display->display_options['access']['type'] = 'none';
+    $handler->display->display_options['cache']['type'] = 'none';
+    $handler->display->display_options['query']['type'] = 'views_query';
+    $handler->display->display_options['exposed_form']['type'] = 'basic';
+    $handler->display->display_options['exposed_form']['options']['reset_button'] = TRUE;
+    $handler->display->display_options['pager']['type'] = 'full';
+    $handler->display->display_options['pager']['options']['items_per_page'] = '10';
+    $handler->display->display_options['style_plugin'] = 'table';
+    $handler->display->display_options['style_options']['columns'] = array(
+      'nid' => 'nid',
+      'title' => 'title',
+      'sample_date' => 'sample_date',
+    );
+    $handler->display->display_options['style_options']['default'] = '-1';
+    $handler->display->display_options['style_options']['info'] = array(
+      'nid' => array(
+        'sortable' => 0,
+        'default_sort_order' => 'asc',
+        'align' => '',
+        'separator' => '',
+        'empty_column' => 0,
+      ),
+      'title' => array(
+        'sortable' => 0,
+        'default_sort_order' => 'asc',
+        'align' => '',
+        'separator' => '',
+        'empty_column' => 0,
+      ),
+      'sample_date' => array(
+        'sortable' => 1,
+        'default_sort_order' => 'asc',
+        'align' => '',
+        'separator' => '',
+        'empty_column' => 0,
+      ),
+    );
+    /* Field: Content: Nid */
+    $handler->display->display_options['fields']['nid']['id'] = 'nid';
+    $handler->display->display_options['fields']['nid']['table'] = 'node';
+    $handler->display->display_options['fields']['nid']['field'] = 'nid';
+    /* Field: Content: Title */
+    $handler->display->display_options['fields']['title']['id'] = 'title';
+    $handler->display->display_options['fields']['title']['table'] = 'node';
+    $handler->display->display_options['fields']['title']['field'] = 'title';
+    $handler->display->display_options['fields']['title']['label'] = '';
+    $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
+    $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
+    /* Field: Content: Sample date */
+    $handler->display->display_options['fields']['sample_date']['id'] = 'sample_date';
+    $handler->display->display_options['fields']['sample_date']['table'] = 'field_data_sample_date';
+    $handler->display->display_options['fields']['sample_date']['field'] = 'sample_date';
+    $handler->display->display_options['fields']['sample_date']['settings'] = array(
+      'format_type' => 'short',
+      'custom_date_format' => '',
+      'fromto' => 'both',
+      'multiple_number' => '',
+      'multiple_from' => '',
+      'multiple_to' => '',
+      'show_remaining_days' => 0,
+      'show_repeat_rule' => 'show',
+    );
+    /* Filter criterion: Content: Type */
+    $handler->display->display_options['filters']['type']['id'] = 'type';
+    $handler->display->display_options['filters']['type']['table'] = 'node';
+    $handler->display->display_options['filters']['type']['field'] = 'type';
+    $handler->display->display_options['filters']['type']['value'] = array(
+      'story' => 'story',
+    );
+    $handler->display->display_options['filters']['type']['group'] = 1;
+    /* Filter criterion: Content: Sample date (sample_date) */
+    $handler->display->display_options['filters']['sample_date_select']['id'] = 'sample_date_select';
+    $handler->display->display_options['filters']['sample_date_select']['table'] = 'field_data_sample_date';
+    $handler->display->display_options['filters']['sample_date_select']['field'] = 'sample_date_value';
+    $handler->display->display_options['filters']['sample_date_select']['group'] = 1;
+    $handler->display->display_options['filters']['sample_date_select']['exposed'] = TRUE;
+    $handler->display->display_options['filters']['sample_date_select']['expose']['operator_id'] = 'sample_date_select_op';
+    $handler->display->display_options['filters']['sample_date_select']['expose']['label'] = 'Select filter';
+    $handler->display->display_options['filters']['sample_date_select']['expose']['operator'] = 'sample_date_select_op';
+    $handler->display->display_options['filters']['sample_date_select']['expose']['identifier'] = 'sample_date_select';
+    $handler->display->display_options['filters']['sample_date_select']['expose']['remember_roles'] = array(
+      2 => 0,
+      1 => 0,
+    );
+    $handler->display->display_options['filters']['sample_date_select']['granularity'] = 'month';
+    $handler->display->display_options['filters']['sample_date_select']['year_range'] = '-2:+2';
+    /* Filter criterion: Content: Sample date (sample_date) */
+    $handler->display->display_options['filters']['sample_date_text']['id'] = 'sample_date_text';
+    $handler->display->display_options['filters']['sample_date_text']['table'] = 'field_data_sample_date';
+    $handler->display->display_options['filters']['sample_date_text']['field'] = 'sample_date_value';
+    $handler->display->display_options['filters']['sample_date_text']['group'] = 1;
+    $handler->display->display_options['filters']['sample_date_text']['exposed'] = TRUE;
+    $handler->display->display_options['filters']['sample_date_text']['expose']['operator_id'] = 'sample_date_text_op';
+    $handler->display->display_options['filters']['sample_date_text']['expose']['label'] = 'Text filter';
+    $handler->display->display_options['filters']['sample_date_text']['expose']['operator'] = 'sample_date_text_op';
+    $handler->display->display_options['filters']['sample_date_text']['expose']['identifier'] = 'sample_date_text';
+    $handler->display->display_options['filters']['sample_date_text']['expose']['remember_roles'] = array(
+      2 => 0,
+      1 => 0,
+    );
+    $handler->display->display_options['filters']['sample_date_text']['granularity'] = 'month';
+    $handler->display->display_options['filters']['sample_date_text']['form_type'] = 'date_text';
+    $handler->display->display_options['filters']['sample_date_text']['year_range'] = '-2:+2';
+    /* Filter criterion: Content: Sample date (sample_date) */
+    $handler->display->display_options['filters']['sample_date_popup']['id'] = 'sample_date_popup';
+    $handler->display->display_options['filters']['sample_date_popup']['table'] = 'field_data_sample_date';
+    $handler->display->display_options['filters']['sample_date_popup']['field'] = 'sample_date_value';
+    $handler->display->display_options['filters']['sample_date_popup']['group'] = 1;
+    $handler->display->display_options['filters']['sample_date_popup']['exposed'] = TRUE;
+    $handler->display->display_options['filters']['sample_date_popup']['expose']['operator_id'] = 'sample_date_popup_op';
+    $handler->display->display_options['filters']['sample_date_popup']['expose']['label'] = 'Popup filter';
+    $handler->display->display_options['filters']['sample_date_popup']['expose']['operator'] = 'sample_date_popup_op';
+    $handler->display->display_options['filters']['sample_date_popup']['expose']['identifier'] = 'sample_date_popup';
+    $handler->display->display_options['filters']['sample_date_popup']['expose']['remember_roles'] = array(
+      2 => 0,
+      1 => 0,
+    );
+    $handler->display->display_options['filters']['sample_date_popup']['granularity'] = 'month';
+    $handler->display->display_options['filters']['sample_date_popup']['form_type'] = 'date_popup';
+    $handler->display->display_options['filters']['sample_date_popup']['year_range'] = '-2:+2';
+
+    /* Display: Page */
+    $handler = $view->new_display('page', 'Page', 'page_samples');
+    $handler->display->display_options['path'] = 'test-date-filter';
+    $handler->display->display_options['menu']['type'] = 'normal';
+    $handler->display->display_options['menu']['title'] = 'Date filters';
+    $handler->display->display_options['menu']['weight'] = '0';
+    $handler->display->display_options['menu']['context'] = 0;
+    $handler->display->display_options['menu']['context_only_inline'] = 0;
+
+    $view->save();
+  }
+
+  /**
+   * Test date filters.
+   */
+  public function testDateFilters() {
+    if (!$this->loggedInUser) {
+      return;
+    }
+
+    try {
+      $this->checkSelectFilter();
+      $this->checkTextFilter('sample_date_text');
+      $this->checkTextFilter('sample_date_popup');
+
+      // @todo Seems to be a bug in popup code that reuses the last filter value
+      // so that query condition is invalid.
+      // (DATE_FORMAT(field_data_sample_date.sample_date_value, '%Y') = '2018-06')
+      $this->validateFilters();
+    }
+    catch(Exception $e) {
+    }
+
+    if ($this->loggedInUser) {
+      $this->drupalLogout();
+    }
+  }
+
+  /**
+   * Test date filter using select widget.
+   */
+  public function checkSelectFilter() {
+    // Restore the view.
+    $this->createDateFilterView();
+
+    $year = (string) (date('Y') - 1);
+    $month = '06';
+    $filter = 'sample_date_select';
+
+    // Set the filter value.
+    $edit = array(
+      'options[value][value_group][value][year]' => $year,
+      'options[value][value_group][value][month]' => substr($month, -1),
+    );
+    $this->setFilter($filter, $edit);
+
+    // Inspect the table.
+    $this->checkTable(1, $year);
+
+    // Inspect the filter value.
+    $this->checkSelect($filter, 'year', $year);
+    $this->checkSelect($filter, 'month', substr($month, -1));
+
+    // Change granularity.
+    $this->setGranularity($filter, 'year');
+
+    // Inspect the table.
+    $this->checkTable(10, $year);
+
+    // Inspect the filter value.
+    $this->checkSelect($filter, 'year', $year);
+  }
+
+  /**
+   * Test date filter using text or popup widget.
+   *
+   * @param string $filter
+   *   Filter name.
+   */
+  public function checkTextFilter($filter) {
+    // Restore the view.
+    $this->createDateFilterView();
+
+    $year = (string) (date('Y') - 1);
+    $month = '06';
+
+    // Set the filter value.
+    $edit = array(
+      'options[value][value_group][value][date]' => "$year-$month",
+    );
+    $this->setFilter($filter, $edit);
+
+    // Inspect the table.
+    $this->checkTable(1, $year);
+
+    // Inspect the filter value.
+    $this->checkTextField($filter, "$year-$month");
+
+    // Change granularity.
+    $this->setGranularity($filter, 'year');
+
+    // Set the filter value.
+    // This is not necessary with the text widget but is with the popup widget.
+    // The popup element retains the first value and the views query uses it.
+    $edit = array(
+      'options[value][value_group][value][date]' => "$year",
+    );
+    $this->setFilter($filter, $edit);
+
+    // Inspect the table.
+    $this->checkTable(10, $year);
+
+    // Inspect the filter value.
+    $this->checkTextField($filter, $year);
+  }
+
+  /**
+   * Test date filter validation using all widgets.
+   */
+  public function validateFilters() {
+    // Restore the view.
+    $this->createDateFilterView();
+
+    $year = (string) (date('Y') - 1);
+    $month = '06';
+
+    // Set the filter values.
+    $edit = array(
+      'sample_date_select[value][year]' => $year,
+      'sample_date_text[value][date]' => $year,
+      'sample_date_popup[value][date]' => $year,
+    );
+
+    // View the page.
+    // The views exposed form uses a GET method not POST.
+    $options = array('query' => $edit);
+    $this->drupalGet('test-date-filter', $options);
+
+    $messages = array(
+      'The value input for field Select filter is invalid',
+      'The month is missing',
+      'The value input for field Text filter is invalid',
+      "The value $year does not match the expected format",
+      'The value input for field Popup filter is invalid',
+      "The value $year does not match the expected format",
+    );
+    foreach ($messages as $message) {
+      $this->assertText($message, "Found error message: {$message}");
+    }
+  }
+
+  /**
+   * Set value of a date filter.
+   *
+   * @param string $filter
+   *   Filter name.
+   * @param string $edit
+   *   The associative array of form input values.
+   */
+  public function setFilter($filter, $edit) {
+    // Load view configuration dialog.
+    $this->drupalGet($this->config_url . '/' . $filter);
+    $this->drupalPost(NULL, $edit, t('Apply'));
+
+    // Save the view.
+    $edit = array();
+    $this->drupalPost(NULL, $edit, t('Save'));
+  }
+
+  /**
+   * Set granularity of a date filter.
+   *
+   * @param string $filter
+   *   Filter name.
+   * @param string $granularity
+   *   The granularity value.
+   */
+  public function setGranularity($filter, $granularity) {
+    // Load view configuration dialog.
+    $this->drupalGet($this->extra_url . '/' . $filter);
+    $edit = array(
+      'options[granularity]' => $granularity,
+    );
+    $this->drupalPost(NULL, $edit, t('Apply'));
+
+    // Save the view.
+    $edit = array();
+    $this->drupalPost(NULL, $edit, t('Save'));
+  }
+
+  /**
+   * Inspect the select field[s] of a date filter.
+   *
+   * @param string $filter
+   *   Filter name.
+   * @param string $part
+   *   Date part.
+   * @param string $expected
+   *   The expected field value.
+   */
+  public function checkSelect($filter, $part, $expected) {
+    // Inspect the filter value.
+    $xpath = '//select[@name="' . $filter . '[value][' . $part . ']"]';
+    $elements = $this->xpath($xpath);
+    if (is_array($elements)) {
+      $select = $elements[0];
+      $value = $this->getSelectedItem($select);
+      $this->assertEqual($value, $expected, "Filter contains $expected");
+    }
+    else {
+      $this->assertTrue(FALSE, "Filter does NOT contain $expected");
+    }
+  }
+
+  /**
+   * Inspect the text field of a date filter.
+   *
+   * @param string $filter
+   *   Filter name.
+   * @param string $expected
+   *   The expected field value.
+   */
+  public function checkTextField($filter, $expected) {
+    // Inspect the filter value.
+    $xpath = '//input[@name="' . $filter . '[value][date]"]';
+    $elements = $this->xpath($xpath);
+    if (is_array($elements)) {
+      $value = (array) $elements[0];
+      $value = $value['@attributes']['value'];
+      $this->assertEqual($value, $expected, "Filter contains $expected");
+    }
+    else {
+      $this->assertTrue(FALSE, "Filter does NOT contain $expected");
+    }
+  }
+
+  /**
+   * Inspect contents of view output table.
+   *
+   * @param int $count
+   *   Expected number of rows in table.
+   * @param string $year
+   *   Expected year value in cells of table.
+   */
+  public function checkTable($count, $year) {
+    // View the page.
+    $this->drupalGet('test-date-filter');
+
+    // Count rows in table.
+    $xpath = '//table[contains(@class, "views-table")]//tbody//tr';
+    $elements = $this->xpath($xpath);
+    if (is_array($elements)) {
+      $this->assertEqual(count($elements), $count, "Table contains $count rows for $year");
+    }
+    else {
+      $this->assertTrue(FALSE, "Table is empty for $year");
+    }
+
+    // Check values in table.
+    // views-field views-field-sample-date
+    $xpath = '//td[contains(@class, "views-field-sample-date")]//span';
+    $elements = $this->xpath($xpath);
+    if (is_array($elements)) {
+      foreach ($elements as $key => $element) {
+        $row = $key + 1;
+        $this->assertTrue(strpos((string) $element, $year) !== FALSE, "Year in row $row is $year");
+      }
+    }
+    else {
+      $this->assertTrue(FALSE, "Table rows are empty for $year");
+    }
+  }
+
+}
diff --git a/drupal7/sites/all/modules/date/tests/date_views_pager.test b/drupal7/sites/all/modules/date/date_views/tests/date_views_pager.test
similarity index 92%
rename from drupal7/sites/all/modules/date/tests/date_views_pager.test
rename to drupal7/sites/all/modules/date/date_views/tests/date_views_pager.test
index 4f5dd97d..f165076f 100644
--- a/drupal7/sites/all/modules/date/tests/date_views_pager.test
+++ b/drupal7/sites/all/modules/date/date_views/tests/date_views_pager.test
@@ -4,7 +4,9 @@
  * @file
  * Views date pager test.
  */
-
+/**
+ *
+ */
 class ViewsPagerTestCase extends DrupalWebTestCase {
   /**
    * Test info.
@@ -14,19 +16,23 @@ class ViewsPagerTestCase extends DrupalWebTestCase {
       'name' => 'Date views pager skipping test',
       'description' => "Views date pager, option to skip empty pages test",
       'group' => 'Date',
+      'dependencies' => array('ctools', 'views'),
     );
   }
 
   /**
-   * Test setup actions.
+   * {@inheritdoc}
    */
-  public function setUp() {
-    // Load the 'date_views', 'views', 'views_ui', 'ctools' modules.
-    parent::setUp('date_views', 'views', 'views_ui', 'ctools');
-    // Set required permissions.
-    $permissions = array('administer views', 'administer site configuration');
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_views';
+    $modules[] = 'ctools';
+    $modules[] = 'views';
+    $modules[] = 'views_ui';
+    parent::setUp($modules);
+
     // Create admin user and login.
-    $admin_user = $this->drupalCreateUser($permissions);
+    $perms = array('administer views', 'administer site configuration');
+    $admin_user = $this->drupalCreateUser($perms);
     $this->drupalLogin($admin_user);
 
     // Create a new view for test.
@@ -38,7 +44,7 @@ class ViewsPagerTestCase extends DrupalWebTestCase {
     $view->human_name = 'test_date_pager';
     $view->core = 7;
     $view->api_version = '3.0';
-    $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+    $view->disabled = FALSE; /* Edit this to TRUE to make a default view disabled initially */
 
     /* Display: Master */
     $handler = $view->new_display('default', 'Master', 'default');
@@ -114,11 +120,13 @@ class ViewsPagerTestCase extends DrupalWebTestCase {
    */
   public function testPagerWarning() {
     $this->drupalCreateNode(array('type' => 'blog'));
+
     // Set pager to skip empty pages.
     $edit = array(
       'pager_options[skip_empty_pages]' => FALSE,
     );
     $this->drupalPost('admin/structure/views/nojs/display/test_date_pager/default/pager_options', $edit, t('Apply'));
+
     // Save the view.
     $this->drupalPost('admin/structure/views/view/test_date_pager/edit', array(), t('Save'));
 
diff --git a/drupal7/sites/all/modules/date/date_views/theme/date-views-filter-form.tpl.php b/drupal7/sites/all/modules/date/date_views/theme/date-views-filter-form.tpl.php
index ad638c10..efc7eb4c 100644
--- a/drupal7/sites/all/modules/date/date_views/theme/date-views-filter-form.tpl.php
+++ b/drupal7/sites/all/modules/date/date_views/theme/date-views-filter-form.tpl.php
@@ -4,18 +4,18 @@
  * @file
  * Template to display the Views date filter form.
  *
- * Values available vary depending on the operator. The availability
- * of date vs adjustment depending on the filter settings. It can
- * be date-only, date and adjustment, or adjustment only.
+ * Values available vary depending on the operator. The availability of date vs
+ * adjustment depending on the filter settings. It can be date-only, date and
+ * adjustment, or adjustment only.
  *
- * If the operator is anything but 'Is between' or 'Is not between',
- * a single date and adjustment field is available.
+ * If the operator is anything but 'Is between' or 'Is not between', a single
+ * date and adjustment field is available.
  *
  * $date
  * $adjustment
  *
- * If the operator is 'Is between' or 'Is not between',
- * two date and adjustment fields are available.
+ * If the operator is 'Is between' or 'Is not between', two date and adjustment
+ * fields are available.
  *
  * $mindate
  * $minadjustment
@@ -28,28 +28,27 @@
  */
 ?>
 <div class="date-views-filter-wrapper">
-<div class="container-inline-date date-clear">
-<?php if (!empty($date) || !empty($adjustment)) : ?>
-  <div class="date-clear">
-    <div class="date-views-filter"><?php print $date; ?></div>
-    <div class="date-views-filter"><?php print $adjustment ?></div>
+  <div class="container-inline-date date-clear">
+  <?php if (!empty($date) || !empty($adjustment)): ?>
+    <div class="date-clear">
+      <div class="date-views-filter"><?php print $date; ?></div>
+      <div class="date-views-filter"><?php print $adjustment ?></div>
+    </div>
+  <?php endif; ?>
+  <?php if (!empty($mindate) || !empty($minadjustment)): ?>
+    <div class="date-clear">
+      <div class="date-views-filter"><?php print $mindate; ?></div>
+      <div class="date-views-filter"><?php print $minadjustment; ?></div>
+    </div>
+  <?php endif; ?>
+  <?php if (!empty($maxdate) || !empty($maxadjustment)): ?>
+    <div class="date-clear">
+      <div class="date-views-filter"><?php print $maxdate; ?></div>
+      <div class="date-views-filter"><?php print $maxadjustment; ?></div>
+    </div>
+  <?php endif; ?>
   </div>
-<?php endif; ?>
-<?php if (!empty($mindate) || !empty($minadjustment)) : ?>
-  <div class="date-clear">
-    <div class="date-views-filter"><?php print $mindate; ?></div>
-    <div class="date-views-filter"><?php print $minadjustment; ?></div>
-  </div>
-<?php endif; ?>
-<?php if (!empty($maxdate) || !empty($maxadjustment)) : ?>
-  <div class="date-clear">
-    <div class="date-views-filter"><?php print $maxdate; ?></div>
-    <div class="date-views-filter"><?php print $maxadjustment; ?></div>
-  </div>
-<?php endif; ?>
-</div>
-<div class="date-clear form-item"><div class="description">
-  <?php print $description; ?>
-</div>
-</div>
+  <div class="date-clear form-item"><div class="description">
+    <?php print $description; ?>
+  </div></div>
 </div>
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 ac8cfb4e..4de773d6 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
@@ -1,33 +1,33 @@
 <?php
+
 /**
  * @file
  * Template file for the example display.
  *
  * Variables available:
- * 
+ *
  * $plugin: The pager plugin object. This contains the view.
  *
  * $plugin->view
  *   The view object for this navigation.
  *
  * $nav_title
- *   The formatted title for this view. In the case of block
- *   views, it will be a link to the full view, otherwise it will
- *   be the formatted name of the year, month, day, or week.
+ *   The formatted title for this view. In the case of block views, it will be a
+ *   link to the full view, otherwise it will be the formatted name of the year,
+ *   month, day, or week.
  *
  * $prev_url
  * $next_url
- *   Urls for the previous and next calendar pages. The links are
- *   composed in the template to make it easier to change the text,
- *   add images, etc.
+ *   Urls for the previous and next calendar pages. The links are composed in
+ *   the template to make it easier to change the text, add images, etc.
  *
  * $prev_options
  * $next_options
- *   Query strings and other options for the links that need to
- *   be used in the l() function, including rel=nofollow.
+ *   Query strings and other options for the links that need to be used in the
+ *   l() function, including rel=nofollow.
  */
 ?>
-<?php if (!empty($pager_prefix)) : ?>
+<?php if (!empty($pager_prefix)): ?>
 <?php print $pager_prefix; ?>
 <?php endif; ?>
 <div class="date-nav-wrapper clearfix<?php if (!empty($extra_classes)): print $extra_classes; endif; ?>">
@@ -36,7 +36,7 @@
       <h3><?php print $nav_title ?></h3>
     </div>
     <ul class="pager">
-    <?php if (!empty($prev_url)) : ?>
+    <?php if (!empty($prev_url)): ?>
       <li class="date-prev">
         <?php
         $text = '&laquo;';
@@ -45,7 +45,7 @@
         ?>
       </li>
     <?php endif; ?>
-    <?php if (!empty($next_url)) : ?>
+    <?php if (!empty($next_url)): ?>
       <li class="date-next">
         <?php print l(($mini ? '' : t('Next', array(), array('context' => 'date_nav')) . ' ') . '&raquo;', $next_url, $next_options); ?>
       </li>
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 7ca03f3a..f68c6715 100644
--- a/drupal7/sites/all/modules/date/date_views/theme/theme.inc
+++ b/drupal7/sites/all/modules/date/date_views/theme/theme.inc
@@ -20,9 +20,6 @@ function date_views_preprocess_views_view(&$vars) {
       case 'both':
         $vars['header'] .= $vars['pager'];
         break;
-
-      default:
-        // Already on the bottom.
     }
   }
 }
@@ -60,8 +57,8 @@ function template_preprocess_date_views_pager(&$vars) {
   $min_date = $date_info->min_date;
   $max_date = $date_info->max_date;
 
-  // Set up the pager link format. Setting the block identifier
-  // will force pager style links.
+  // Set up the pager link format. Setting the block identifier will force
+  // pager style links.
   if ((isset($date_info->date_pager_format) && $date_info->date_pager_format != 'clean') || !empty($date_info->mini)) {
     if (empty($date_info->block_identifier)) {
       $date_info->block_identifier = $date_info->pager_id;
@@ -79,6 +76,7 @@ function template_preprocess_date_views_pager(&$vars) {
           $prev_week = date_week(date_format($prev_date, 'Y-m-d'));
           $prev_arg = date_format($prev_date, 'o-\W') . date_pad($prev_week);
           break;
+
         default:
           $prev_arg = date_format($prev_date, $format[$granularity]);
       }
@@ -92,6 +90,7 @@ function template_preprocess_date_views_pager(&$vars) {
           $next_week = date_week(date_format($next_date, 'Y-m-d'));
           $next_arg = date_format($next_date, 'o-\W') . date_pad($next_week);
           break;
+
         default:
           $next_arg = date_format($next_date, $format[$granularity]);
       }
@@ -110,8 +109,8 @@ function template_preprocess_date_views_pager(&$vars) {
     $vars['next_options'] = $vars['prev_options'] = array();
   }
 
-  // Check whether navigation links would point to
-  // a date outside the allowed range.
+  // Check whether navigation links would point to a date outside the allowed
+  // range.
   if (!empty($next_date) && !empty($vars['next_url']) && date_format($next_date, 'Y') > $date_info->limit[1]) {
     $vars['next_url'] = '';
   }
@@ -145,6 +144,7 @@ function template_preprocess_date_views_pager(&$vars) {
       $next_title = t('Navigate to next day');
       break;
   }
+
   $vars['prev_options']['attributes'] += array('title' => $prev_title);
   $vars['next_options']['attributes'] += array('title' => $next_title);
 
@@ -183,6 +183,7 @@ function theme_date_nav_title($params) {
   $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;
@@ -213,6 +214,7 @@ function theme_date_nav_title($params) {
       $date_arg = $date_info->year . '-W' . date_pad($date_info->week);
       break;
   }
+
   if (!empty($date_info->mini) || $link) {
     // Month navigation titles are used as links in the mini view.
     $attributes = array('title' => t('View full page month'));
@@ -236,4 +238,5 @@ function template_preprocess_date_views_filter_form(&$vars) {
   $vars['minadjustment'] = drupal_render($form['minadjustment']);
   $vars['maxadjustment'] = drupal_render($form['maxadjustment']);
   $vars['description'] = drupal_render($form['description']) . drupal_render($form);
+  drupal_add_css(drupal_get_path('module', 'date_api') . '/date.css');
 }
diff --git a/drupal7/sites/all/modules/date/tests/DateEmwTestCase.test b/drupal7/sites/all/modules/date/tests/DateEmwTestCase.test
new file mode 100644
index 00000000..e12b36fc
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/DateEmwTestCase.test
@@ -0,0 +1,143 @@
+<?php
+
+/**
+ * @file
+ * Test Date (ISO) and the Entity Metadata Wrappers play well together.
+ */
+
+/**
+ * Test Date (ISO) and the Entity Metadata Wrappers play well together.
+ */
+class DateEmwTestCase extends DrupalWebTestCase {
+
+  /**
+   * Info about this test.
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'Date Entity Metadata Wrappers',
+      'description' => 'Ensure default timezone setting in metadata wrapper integration is working as expected.',
+      'group' => 'Date',
+      'dependencies' => array('entity'),
+    );
+  }
+
+  /**
+   * Set up a user and a content type with a Date (ISO) field.
+   */
+  public function setUp(array $modules = array()) {
+    // Define the dependencies.
+    $modules[] = 'date_api';
+    $modules[] = 'date';
+    $modules[] = 'field';
+    $modules[] = 'field_ui';
+    $modules[] = 'entity';
+    $modules[] = 'entity_token';
+    parent::setUp($modules);
+
+    // Select a specific default timezone, and turn off user-configurable
+    // timezone handling.
+    variable_set('date_default_timezone', 'Pacific/Honolulu');
+    variable_set('configurable_timezones', 0);
+
+    // Create a privileged user and log in with it.
+    $this->privileged_user = $this->drupalCreateUser(array(
+      'administer site configuration',
+      'administer content types',
+      'administer nodes',
+      'bypass node access',
+      'administer fields',
+    ));
+    $this->drupalLogin($this->privileged_user);
+
+    // Create a content type to which we can add our date fields.
+    $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.');
+
+    // Add each of our date field types.
+    $this->date_types = array(
+      'date' => 'Date (ISO format)',
+      'datetime' => 'Date',
+      'datestamp' => 'Date (Unix timestamp)',
+    );
+    foreach ($this->date_types as $type => $label) {
+      $field_name_for_human = 'test_' . $type;
+
+      // Add the field.
+      $field = array();
+      $field['fields[_add_new_field][label]'] = $label;
+      $field['fields[_add_new_field][field_name]'] = $field_name_for_human;
+      $field['fields[_add_new_field][type]'] = $type;
+      $field['fields[_add_new_field][widget_type]'] = 'date_text';
+      $this->drupalPost('admin/structure/types/manage/story/fields', $field, 'Save');
+      $this->assertText('These settings apply to the ' . $field['fields[_add_new_field][label]'] . ' field everywhere it is used.', $label . ' field added to content type.');
+
+      // Set the timezone handling to 'none'.
+      $field = array();
+      $field['field[settings][tz_handling]'] = 'none';
+      $this->drupalPost('admin/structure/types/manage/story/fields/field_' . $field_name_for_human, $field, 'Save settings');
+      $this->assertText('Saved ' . $label . ' configuration.');
+    }
+  }
+
+  /**
+   * Test the edge case where timezone_db is empty.
+   *
+   * In this case the value returned by entity metadata wrappers is not the same
+   * as that which is stored in the node.
+   *
+   * @see https://www.drupal.org/node/2123039
+   */
+  public function testCheckEntityMetadataWrapper() {
+    // Create and save a edit.
+    $edit = array();
+    $edit['title'] = 'Testing dates';
+    $edit['type'] = 'story';
+    $this->drupalCreateNode($edit);
+    // Fetch the Node.
+    $node = $this->drupalGetNodeByTitle($edit['title']);
+    // Prepare variables for token replacement.
+    $variables['node'] = $node;
+    // At this point we have a node with the appropriate field types available.
+    $wrapper = entity_metadata_wrapper('node', $node);
+    $original = '1482721671';
+    foreach ($this->date_types as $type => $label) {
+      $field = 'field_test_' . $type;
+      $wrapper->{$field} = $original;
+      $from_metadata_wrapper = $wrapper->{$field}->value();
+
+      $this->assertEqual(
+        $original,
+        $from_metadata_wrapper,
+        t(
+          '!type plays nicely with Entity Metadata Wrappers. !original == !fetched',
+          array(
+            '!type' => $label,
+            '!original' => $original,
+            '!fetched' => $from_metadata_wrapper,
+          )
+        )
+      );
+
+      $token = "[node:field-test-${type}:raw]";
+      $from_token = token_replace($token, $variables);
+
+      $this->assertEqual(
+        $original,
+        $from_token,
+        t(
+          '!type plays nicely with Entity tokens. !original == !fetched',
+          array(
+            '!type' => $label,
+            '!original' => $original,
+            '!fetched' => $from_token,
+          )
+        )
+      );
+    }
+  }
+
+}
diff --git a/drupal7/sites/all/modules/date/tests/date_field.test b/drupal7/sites/all/modules/date/tests/DateFieldTestBase.test
similarity index 83%
rename from drupal7/sites/all/modules/date/tests/date_field.test
rename to drupal7/sites/all/modules/date/tests/DateFieldTestBase.test
index b8aad594..feff7f73 100644
--- a/drupal7/sites/all/modules/date/tests/date_field.test
+++ b/drupal7/sites/all/modules/date/tests/DateFieldTestBase.test
@@ -2,26 +2,37 @@
 
 /**
  * @file
- * Basic functions for Date tests.
+ * Shared test functionality.
  */
-abstract class DateFieldBasic extends DrupalWebTestCase {
+
+/**
+ * Shared test functionality.
+ */
+abstract class DateFieldTestBase extends DrupalWebTestCase {
   protected $privileged_user;
 
   /**
-   * @todo.
+   * {@inheritdoc}
    */
-  protected function setUp() {
-    // Load the date_api module.
-    parent::setUp('field', 'field_ui', 'date_api', 'date', 'date_popup', 'date_tools');
+  public function setUp(array $modules = array()) {
+    $modules[] = 'field';
+    $modules[] = 'field_ui';
+    $modules[] = 'date_api';
+    $modules[] = 'date';
+    $modules[] = 'date_tools';
+    parent::setUp($modules);
 
     // Create and log in our privileged user.
-    $this->privileged_user = $this->drupalCreateUser(
-      array('administer content types', 'administer nodes', 'bypass node access', 'administer date tools', 'administer fields')
+    $perms = array(
+      'administer content types',
+      'administer nodes',
+      'bypass node access',
+      'administer date tools',
+      'administer fields',
     );
+    $this->privileged_user = $this->drupalCreateUser($perms);
     $this->drupalLogin($this->privileged_user);
 
-    variable_set('date_popup_timepicker', 'none');
-
     module_load_include('inc', 'node', 'content_types');
     module_load_include('inc', 'node', 'node.pages');
     module_load_include('inc', 'field', 'field.crud');
@@ -32,7 +43,6 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
     $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.');
-
   }
 
   /**
@@ -42,6 +52,7 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
    * different.
    */
   protected function createDateField($values = array()) {
+    $this->verbose($values);
     extract($values);
 
     $field_name = !empty($field_name) ? $field_name : 'field_test';
@@ -60,6 +71,7 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
     $text_parts = !empty($text_parts) ? $text_parts : array();
     $increment = !empty($increment) ? $increment : 15;
     $default_value = !empty($default_value) ? $default_value : 'now';
+    $default_value_code = !empty($default_value_code) ? $default_value_code : NULL;
     $default_value2 = !empty($default_value2) ? $default_value2 : 'blank';
     $default_format = !empty($default_format) ? $default_format : 'long';
     $cache_enabled = !empty($cache_enabled);
@@ -84,8 +96,8 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
       'field_name' => $field_name,
       'label' => $label,
       'bundle' => $bundle,
-      // Move the date right below the title.
-      'weight' => -4,
+      // Move the date to the top.
+      'weight' => -100,
       'widget' => array(
         'type' => $widget_type,
         // Increment for minutes and seconds, can be 1, 5, 10, 15, or 30.
@@ -100,10 +112,11 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
           'label_position' => 'above',
           'repeat_collapsed' => 0,
         ),
-        'weight' => -4,
+        'weight' => -100,
       ),
       'settings' => array(
         'default_value' => $default_value,
+        'default_value_code' => $default_value_code,
         'default_value2' => $default_value2,
       ),
     );
@@ -139,16 +152,18 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
       ),
     );
 
+    $this->verbose($field);
     $field = field_create_field($field);
+
+    $this->verbose($instance);
     $instance = field_create_instance($instance);
 
-    field_info_cache_clear(TRUE);
-    field_cache_clear(TRUE);
+    field_info_cache_clear();
+    field_cache_clear();
 
     // Look at how the field got configured.
     $this->drupalGet("admin/structure/types/manage/$bundle/fields/$field_name");
     $this->drupalGet("admin/structure/types/manage/$bundle/display");
-
   }
 
   /**
@@ -202,8 +217,8 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
       'field_name' => $field_name,
       'label' => $label,
       'bundle' => $bundle,
-      // Move the date right below the title.
-      'weight' => -4,
+      // Move the date to the top.
+      'weight' => -100,
       'widget' => array(
         'type' => $widget_type,
         // Increment for minutes and seconds, can be 1, 5, 10, 15, or 30.
@@ -218,7 +233,7 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
           'label_position' => 'above',
           'repeat_collapsed' => 0,
         ),
-        'weight' => -4,
+        'weight' => -100,
       ),
       'settings' => array(
         'default_value' => $default_value,
@@ -260,10 +275,11 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
     $field = field_create_field($field);
     $instance = field_create_instance($instance);
 
-    field_info_cache_clear(TRUE);
-    field_cache_clear(TRUE);
+    field_info_cache_clear();
+    field_cache_clear();
 
     // Look at how the field got configured.
+    $this->drupalGet("admin/structure/types/manage/$bundle/fields");
     $this->drupalGet("admin/structure/types/manage/$bundle/fields/$field_name");
     $this->drupalGet("admin/structure/types/manage/$bundle/display");
   }
@@ -278,49 +294,29 @@ abstract class DateFieldBasic extends DrupalWebTestCase {
     $this->assertText("The field $label has been deleted from the $bundle_name content type.", 'Removed date field.');
   }
 
-}
-
-class DateFieldTestCase extends DateFieldBasic {
-
   /**
-   * @todo.
+   * {@inheritdoc}
    */
-  public static function getInfo() {
-    return array(
-      'name' => 'Date Field',
-      'description' => 'Test date field settings and Start/End date interaction.',
-      'group' => 'Date',
-    );
-  }
+  protected function verbose($message, $title = NULL) {
+    // Handle arrays, objects, etc.
+    if (!is_string($message)) {
+      $message = "<pre>\n" . print_r($message, TRUE) . "\n</pre>\n";
+    }
 
-  /**
-   * @todo.
-   */
-  public function testField() {
-    // Create a date fields with simple values.
-    foreach (array('date', 'datestamp', 'datetime') as $field_type) {
-      foreach (array('date_select', 'date_popup', 'date_text') as $widget_type) {
-        $field_name = "field_test_$widget_type";
-        $label = 'Test';
-        $options = array(
-          'label' => $label,
-          'widget_type' => $widget_type,
-          'field_name' => $field_name,
-          'field_type' => $field_type,
-          'input_format' => 'm/d/Y - H:i',
-        );
-        $this->createDateField($options);
-        $this->dateForm($field_name, $field_type, $widget_type);
-        $this->deleteDateField($label);
-      }
+    // Optional title to go before the output.
+    if (!empty($title)) {
+      $title = '<h2>' . check_plain($title) . "</h2>\n";
     }
+
+    parent::verbose($title . $message);
   }
 
   /**
-   * @todo.
+   * Tests that date field functions properly.
    */
   public function dateForm($field_name, $field_type, $widget_type, $todate = TRUE) {
-    // Tests that date field functions properly.
+    $this->verbose(func_get_args());
+
     $edit = array();
     $edit['title'] = $this->randomName(8);
     if ($widget_type == 'date_select') {
@@ -354,9 +350,9 @@ class DateFieldTestCase extends DateFieldBasic {
         $edit[$field_name . '[und][0][value2][time]'] = '11:30';
       }
     }
+
     // Test that the date is displayed correctly using both the 'short' and
     // 'long' date types.
-    //
     // For the short type, save an explicit format and assert that is the one
     // which is displayed.
     variable_set('date_format_short', 'l, m/d/Y - H:i:s');
@@ -367,6 +363,7 @@ class DateFieldTestCase extends DateFieldBasic {
     $this->assertText($edit['title'], "Node has been created");
     $should_be = $todate ? 'Thursday, 10/07/2010 - 10:30 to 11:30' : 'Thursday, 10/07/2010 - 10:30';
     $this->assertText($should_be, "Found the correct date for a $field_type field using the $widget_type widget displayed using the short date format.");
+
     // For the long format, do not save anything, and assert that the displayed
     // date uses the expected default value of this format provided by Drupal
     // core ('l, F j, Y - H:i').
@@ -378,4 +375,32 @@ class DateFieldTestCase extends DateFieldBasic {
     $should_be = $todate ? 'Thursday, October 7, 2010 - 10:30 to 11:30' : 'Thursday, October 7, 2010 - 10:30';
     $this->assertText($should_be, "Found the correct date for a $field_type field using the $widget_type widget displayed using the long date format.");
   }
+
+  /**
+   * Run some tests against a specific field type/widget combination.
+   *
+   * @param string $field_type
+   *   The field type to use.
+   * @param string $widget_type
+   *   The widget type to use.
+   * @param bool $delete_when_done
+   *   Whether to delete the field when it's finished; defaults to TRUE.
+   */
+  protected function checkDateField($field_type, $widget_type, $delete_when_done = TRUE) {
+    $field_name = "field_test_$widget_type";
+    $label = 'Test';
+    $options = array(
+      'label' => $label,
+      'widget_type' => $widget_type,
+      'field_name' => $field_name,
+      'field_type' => $field_type,
+      'input_format' => 'm/d/Y - H:i',
+    );
+    $this->createDateField($options);
+    $this->dateForm($field_name, $field_type, $widget_type);
+    if ($delete_when_done) {
+      $this->deleteDateField($label);
+    }
+  }
+
 }
diff --git a/drupal7/sites/all/modules/date/tests/DateFieldTestCase.test b/drupal7/sites/all/modules/date/tests/DateFieldTestCase.test
new file mode 100644
index 00000000..cc8ced9f
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/DateFieldTestCase.test
@@ -0,0 +1,59 @@
+<?php
+
+/**
+ * @file
+ * Test the handling of the two included field widgets.
+ */
+
+/**
+ * Test the handling of the two included field widgets.
+ */
+class DateFieldTestCase extends DateFieldTestBase {
+
+  /**
+   * Test relative default values.
+   */
+  public function testRelativeDefault() {
+    $edit = array();
+    $edit['name'] = 'Date Relative Default Test';
+    $edit['type'] = 'date_relative_default_test';
+    $this->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
+    $this->assertText('The content type Date Relative Default Test has been added.', 'Content type added.');
+
+    $options = array(
+      'bundle' => 'date_relative_default_test',
+      'default_value' => 'strtotime',
+      'default_value_code' => '+1',
+    );
+    $this->createDateField($options);
+
+    $edit = array();
+    $edit['title'] = $this->randomName(8);
+    $this->drupalPost('node/add/date-relative-default-test', $edit, t('Save'));
+
+  }
+
+  /**
+   * @todo.
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'Date Field',
+      'description' => 'Test date field settings and Start/End date interaction.',
+      'group' => 'Date',
+    );
+  }
+
+  /**
+   * Check all of the included field types for basic functionality.
+   */
+  public function testField() {
+    // Create a date fields with simple values.
+    foreach (array('date', 'datestamp', 'datetime') as $field_type) {
+      foreach (array('date_select', 'date_text') as $widget_type) {
+        $this->checkDateField($field_type, $widget_type, TRUE);
+      }
+    }
+  }
+
+}
diff --git a/drupal7/sites/all/modules/date/tests/date_form.test b/drupal7/sites/all/modules/date/tests/DateFormTestCase.test
similarity index 66%
rename from drupal7/sites/all/modules/date/tests/date_form.test
rename to drupal7/sites/all/modules/date/tests/DateFormTestCase.test
index 56b89e43..e5382ab7 100644
--- a/drupal7/sites/all/modules/date/tests/date_form.test
+++ b/drupal7/sites/all/modules/date/tests/DateFormTestCase.test
@@ -5,8 +5,14 @@
  * Contains form specific date element test cases.
  */
 
+/**
+ * Contains form specific date element test cases.
+ */
 class DateFormTestCase extends DrupalWebTestCase {
 
+  /**
+   * {@inheritdoc}
+   */
   public static function getInfo() {
     return array(
       'name' => t('Date Form test'),
@@ -15,9 +21,12 @@ class DateFormTestCase extends DrupalWebTestCase {
     );
   }
 
-  public function setUp() {
-    // Load the date_api module.
-    parent::setUp('date_test');
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_test';
+    parent::setUp($modules);
   }
 
   /**
diff --git a/drupal7/sites/all/modules/date/tests/date_migrate.test b/drupal7/sites/all/modules/date/tests/DateMigrateTestCase.test
similarity index 63%
rename from drupal7/sites/all/modules/date/tests/date_migrate.test
rename to drupal7/sites/all/modules/date/tests/DateMigrateTestCase.test
index ec2ae7d8..669bf88e 100644
--- a/drupal7/sites/all/modules/date/tests/date_migrate.test
+++ b/drupal7/sites/all/modules/date/tests/DateMigrateTestCase.test
@@ -6,9 +6,9 @@
  */
 
 /**
- * Test date migration.
+ * Test for using date fields with Migrate module.
  */
-class DateMigrateExampleUnitTest extends DrupalWebTestCase {
+class DateMigrateTestCase extends DrupalWebTestCase {
 
   /**
    * Provides information about this test.
@@ -16,52 +16,61 @@ class DateMigrateExampleUnitTest extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Date Migration',
-      'description' => 'Test migration into date fields',
+      'description' => 'Test migration into date fields.',
       'group' => 'Date',
       'dependencies' => array('migrate', 'features'),
     );
   }
 
   /**
-   * Declars the module dependencies for the test.
+   * {@inheritdoc}
    */
-  function setUp() {
-    parent::setUp('migrate', 'features', 'date', 'date_repeat',
-                  'date_repeat_field', 'date_migrate_example');
+  public function setUp(array $modules = array()) {
+    $modules[] = 'date_test_feature';
+    $modules[] = 'date_migrate_test';
+    parent::setUp($modules);
+
     // Make sure the migration is registered.
     if (function_exists('migrate_static_registration')) {
-      // Migrate 2.6 and later
+      // Migrate 2.6 and later.
       migrate_static_registration();
     }
     else {
-      // Migrate 2.5 and earlier
+      // Migrate 2.5 and earlier.
       migrate_get_module_apis(TRUE);
     }
   }
 
   /**
-   * Verify that date fields are imported correctly. When no timezone is
-   * explicitly provided with the source data, we want the displayed time on the
-   * Drupal site to match that in the source data. To validate that, we make
-   * sure we have set a consistent timezone at the PHP and Drupal levels, and
-   * that the format used on the page is not locale-dependent (no day or month
-   * names). Then, we can just look for the desired date/time strings in the
-   * node page.
+   * Verify that date fields are imported correctly.
+   *
+   * When no timezone is explicitly provided with the source data, we want the
+   * displayed time on the Drupal site to match that in the source data. To
+   * validate that, we make sure we have set a consistent timezone at the PHP
+   * and Drupal levels, and that the format used on the page is not locale-
+   * dependent (no day or month names). Then, we can just look for the desired
+   * date/time strings in the node page.
    */
-  function testDateImport() {
+  public function testDateImport() {
     date_default_timezone_set('America/Los_Angeles');
     variable_set('date_default_timezone', 'America/Los_Angeles');
     variable_set('date_format_medium', 'Y-m-d H:i');
     $migration = Migration::getInstance('DateExample');
     $result = $migration->processImport();
     $this->assertEqual($result, Migration::RESULT_COMPLETED, t('Variety term import returned RESULT_COMPLETED'));
-    $rawnodes = node_load_multiple(FALSE, array('type' => 'date_migrate_example'), TRUE);
+    $rawnodes = node_load_multiple(FALSE, array('type' => 'date_test_feature'), TRUE);
     $this->assertEqual(count($rawnodes), 2, t('Two sample nodes created'));
+
+    // Test the first imported node.
     $node = reset($rawnodes);
     $this->drupalGet('/node/' . $node->nid);
+    $this->assertText('Simple example', t('Found the first node'));
+    $this->assertText('This is pretty straight-forward.', t('Found the first node'));
     $this->assertText('2011-05-12 19:43', t('Simple date field found'));
     $this->assertText('2011-06-13 18:32 to 2011-07-23 10:32', t('Date range field found'));
     $this->assertText('2011-07-22 12:13', t('Datestamp field found'));
+    // This needs to output the exact time and now "(All day)" because this
+    // field does not have the "all day" option selected.
     $this->assertText('2011-08-01 00:00 to 2011-09-01 00:00', t('Datestamp range field found'));
     $this->assertText('2011-11-18 15:00', t('Datetime field with +9 timezone found'));
     $this->assertText('2011-10-30 14:43 to 2011-12-31 17:59', t('Datetime range field with -5 timezone found'));
@@ -69,8 +78,12 @@ class DateMigrateExampleUnitTest extends DrupalWebTestCase {
     $this->assertText('2011-12-09 09:01', t('Second date repeat instance found'));
     $this->assertNoText('2011-12-23 09:01', t('Skipped date repeat instance not found'));
     $this->assertText('2012-05-11 09:01', t('Last date repeat instance found'));
+
+    // Test the second imported node.
     $node = next($rawnodes);
     $this->drupalGet('/node/' . $node->nid);
+    $this->assertText('Example with multi-value fields', t('Found the second node'));
+    $this->assertText('This is not as straight-forward.', t('Found the second node'));
     $this->assertText('2012-06-21 15:32', t('First date value found'));
     $this->assertText('2012-12-02 11:08', t('Second date value found'));
     $this->assertText('2004-02-03 01:15', t('Start for first date range found'));
@@ -78,4 +91,5 @@ class DateMigrateExampleUnitTest extends DrupalWebTestCase {
     $this->assertText('2014-09-01 17:21', t('Start for second date range found'));
     $this->assertText('2015-12-23 00:01', t('End for first second range found'));
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/tests/DateNowUnitTestCase.test b/drupal7/sites/all/modules/date/tests/DateNowUnitTestCase.test
new file mode 100644
index 00000000..bdab4a37
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/DateNowUnitTestCase.test
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * @file
+ * Test Date Now unit tests.
+ */
+
+/**
+ * Test Date Now unit tests.
+ */
+class DateNowUnitTestCase extends DrupalUnitTestCase {
+
+  /**
+   *
+   */
+  public static function getInfo() {
+    return array(
+      'name' => t('Date Now'),
+      'description' => t('Test Date Now function.') ,
+      'group' => t('Date'),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    drupal_load('module', 'date_api');
+    parent::setUp();
+  }
+
+  public function testDateNowNoTimezone() {
+    // Test without passing a timezone.
+    $now = date_now();
+
+    $this->assertTrue(($now instanceof DateObject), 'Test date_now() returns a DateObject');
+  }
+
+  public function testDateNowStringTimezones() {
+    // Test with a string timezone.
+    $la_time = date_now('America/Los_Angeles');
+    $ny_time = date_now('America/New_York');
+
+    $this->assertTrue(($la_time instanceof DateObject), 'Test America/Los_Angeles returns a DateObject');
+    $this->assertTrue(($ny_time instanceof DateObject), 'Test America/New_York returns a DateObject');
+
+    $this->assertEqual($la_time->getTimestamp(), $ny_time->getTimestamp(), 'Test different timezones have same Unix timestamp');
+  }
+
+  public function testDateNowObjectTimezones() {
+    // Test with object timezones.
+    $la_tz = new DateTimeZone('America/Los_Angeles');
+    $ny_tz = new DateTimeZone('America/New_York');
+
+    $la_time = date_now($la_tz);
+    $ny_time = date_now($ny_tz);
+
+    $this->assertTrue(($la_time instanceof DateObject), 'Test America/Los_Angeles returns a DateObject');
+    $this->assertTrue(($ny_time instanceof DateObject), 'Test America/New_York returns a DateObject');
+
+    $this->assertEqual($la_time->getTimestamp(), $ny_time->getTimestamp(), 'Test different timezones have same Unix timestamp');
+  }
+
+}
diff --git a/drupal7/sites/all/modules/date/tests/date_timezone.test b/drupal7/sites/all/modules/date/tests/DateTimezoneTestCase.test
similarity index 84%
rename from drupal7/sites/all/modules/date/tests/date_timezone.test
rename to drupal7/sites/all/modules/date/tests/DateTimezoneTestCase.test
index 9f2905a2..7034389d 100644
--- a/drupal7/sites/all/modules/date/tests/date_timezone.test
+++ b/drupal7/sites/all/modules/date/tests/DateTimezoneTestCase.test
@@ -1,9 +1,14 @@
 <?php
+
 /**
  * @file
- * Timezone tests.
+ * Test timezone handling.
+ */
+
+/**
+ * Test timezone handling.
  */
-class DateTimezoneTestCase extends DateFieldBasic {
+class DateTimezoneTestCase extends DateFieldTestBase {
 
   /**
    * @todo.
@@ -16,8 +21,12 @@ class DateTimezoneTestCase extends DateFieldBasic {
     );
   }
 
-  public function setUp() {
-    parent::setUp();
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp(array $modules = array()) {
+    parent::setUp($modules);
+
     // Set the timezone explicitly. Otherwise the site's default timezone is
     // used, which defaults to the server timezone when installing Drupal. This
     // depends on the environment and is therefore uncertain.
@@ -53,13 +62,35 @@ class DateTimezoneTestCase extends DateFieldBasic {
             'granularity' => $granularity,
           );
           $this->createDateField($options);
-          $this->dateForm($field_name, $field_type, $max_granularity, $tz_handling);
+          $this->buildDateForm($field_name, $field_type, $max_granularity, $tz_handling);
           $this->deleteDateField($label);
         }
       }
     }
   }
 
+  /**
+   * Test timezone handling validation on the field settings form.
+  */
+  public function testFieldWidgetSettings() {
+    $label = 'Test';
+    $options = array(
+      'label' => $label,
+      'field_type' => 'date',
+      'widget_type' => 'date_select',
+      'granularity' => array('year', 'month', 'day'),
+    );
+    $this->createDateField($options);
+    $this->drupalGet('admin/structure/types/manage/story/fields/field_' . strtolower($label));
+    $this->assertResponse(200);
+    $edit = array(
+      'field[settings][granularity][hour]' => FALSE,
+    );
+    $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($label);
+  }
+
   /**
    * Validates timezone handling with a multi-value date field.
    */
@@ -70,7 +101,7 @@ class DateTimezoneTestCase extends DateFieldBasic {
     $tz_handling = 'date';
     $max_granularity = 'minute';
 
-    // Create date field
+    // Create date field.
     $field_name = "field_test";
     $label = 'Test';
     $options = array(
@@ -85,16 +116,14 @@ class DateTimezoneTestCase extends DateFieldBasic {
     );
     $this->createMultiDateField($options);
 
-    // Submit a date field form with multiple values
+    // Submit a date field form with multiple values.
     $this->dateMultiValueForm($field_name, $field_type, $max_granularity, $tz_handling);
 
-
     $this->deleteDateField($label);
   }
 
   /**
-   * Tests the submission of a date field's widget form when using unlimited
-   * cardinality
+   * Tests the submission of a date field's widget with unlimited cardinality.
    */
   public function dateMultiValueForm($field_name, $field_type, $max_granularity, $tz_handling) {
     variable_set('date_format_long', 'D, m/d/Y - H:i:s T');
@@ -119,6 +148,7 @@ class DateTimezoneTestCase extends DateFieldBasic {
         $should_be[2] = 'Thu, 10/07/2010 - 10 EDT';
 
         break;
+
       case 'minute':
         $edit[$field_name . '[und][0][value][date]'] = '10/07/2010 - 10:30';
         $edit[$field_name . '[und][0][timezone][timezone]'] = 'America/Chicago';
@@ -133,6 +163,7 @@ class DateTimezoneTestCase extends DateFieldBasic {
         $should_be[2] = 'Thu, 10/07/2010 - 10:30 EDT';
 
         break;
+
       case 'second':
         $edit[$field_name . '[und][0][value][date]'] = '10/07/2010 - 10:30';
         $edit[$field_name . '[und][0][timezone][timezone]'] = 'America/Chicago';
@@ -166,9 +197,9 @@ class DateTimezoneTestCase extends DateFieldBasic {
   }
 
   /**
-   * @todo.
+   * Replacement for dateForm().
    */
-  public function dateForm($field_name, $field_type, $max_granularity, $tz_handling) {
+  public function buildDateForm($field_name, $field_type, $max_granularity, $tz_handling) {
     variable_set('date_format_long', 'D, m/d/Y - H:i:s');
     $edit = array();
     $edit['title'] = $this->randomName(8);
@@ -179,16 +210,19 @@ class DateTimezoneTestCase extends DateFieldBasic {
         $edit[$field_name . '[und][0][value2][date]'] = '2011';
         $should_be = '2010 to 2011';
         break;
+
       case 'month':
         $edit[$field_name . '[und][0][value][date]'] = '07/2010';
         $edit[$field_name . '[und][0][value2][date]'] = '08/2010';
         $should_be = '07/2010 to 08/2010';
         break;
+
       case 'day':
         $edit[$field_name . '[und][0][value][date]'] = '10/07/2010';
         $edit[$field_name . '[und][0][value2][date]'] = '10/08/2010';
         $should_be = 'Thu, 10/07/2010 to Fri, 10/08/2010';
         break;
+
       case 'hour':
         $edit[$field_name . '[und][0][value][date]'] = '10/07/2010 - 10';
         $edit[$field_name . '[und][0][value2][date]'] = '10/07/2010 - 11';
@@ -199,6 +233,7 @@ class DateTimezoneTestCase extends DateFieldBasic {
           $should_be = 'Thu, 10/07/2010 - 10 to Thu, 10/07/2010 - 11';
         }
         break;
+
       case 'minute':
         $edit[$field_name . '[und][0][value][date]'] = '10/07/2010 - 10:30';
         $edit[$field_name . '[und][0][value2][date]'] = '10/07/2010 - 11:30';
@@ -209,6 +244,7 @@ class DateTimezoneTestCase extends DateFieldBasic {
           $should_be = 'Thu, 10/07/2010 - 10:30 to 11:30';
         }
         break;
+
       case 'second':
         $edit[$field_name . '[und][0][value][date]'] = '10/07/2010 - 10:30:30';
         $edit[$field_name . '[und][0][value2][date]'] = '10/07/2010 - 11:30:30';
@@ -224,4 +260,5 @@ class DateTimezoneTestCase extends DateFieldBasic {
     $this->assertText($edit['title'], "Node has been created");
     $this->assertText($should_be, "Found the correct date for a $field_type field using $max_granularity granularity with $tz_handling timezone handling.");
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/tests/date.test b/drupal7/sites/all/modules/date/tests/DateUiTestCase.test
similarity index 58%
rename from drupal7/sites/all/modules/date/tests/date.test
rename to drupal7/sites/all/modules/date/tests/DateUiTestCase.test
index 04b06447..d35d3b83 100644
--- a/drupal7/sites/all/modules/date/tests/date.test
+++ b/drupal7/sites/all/modules/date/tests/DateUiTestCase.test
@@ -4,8 +4,10 @@
  * @file
  * Test date UI.
  */
-
-class DateUITestCase extends DateFieldBasic {
+/**
+ *
+ */
+class DateUiTestCase extends DateFieldTestBase {
 
   /**
    * @todo.
@@ -21,8 +23,8 @@ class DateUITestCase extends DateFieldBasic {
   /**
    * @todo.
    */
-  public function setUp() {
-    parent::setUp();
+  public function setUp(array $modules = array()) {
+    parent::setUp($modules);
 
     variable_set('date_format_long', 'D, m/d/Y - H:i');
   }
@@ -34,58 +36,50 @@ class DateUITestCase extends DateFieldBasic {
     $label = 'Test';
     $current_year = date('Y');
 
-    $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) {
+    foreach (array('date', 'datestamp', 'datetime') as $field_type) {
+      // @todo Add back 'date_popup'.
+      foreach (array('date_select', 'date_text') as $widget_type) {
         $this->createDateField(
-            array(
-              'label' => $label,
-              'field_type' => $field_type,
-              'widget_type' => $widget_type,
-            )
+          array(
+            'label' => $label,
+            'field_type' => $field_type,
+            'widget_type' => $widget_type,
+          )
         );
-        $this->dateForm($widget_type);
+        $this->dateForm('blah', 'blah', $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(array('label' => $label, 'field_type' => 'date', 'widget_type' => 'date_select', 'granularity' => array('year', 'month', 'day')));
-    $edit = array('field[settings][granularity][hour]' => FALSE);
-    $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($label);
   }
 
   /**
-   * @todo.
+   * {@inheritdoc}
    */
-  function dateForm($options) {
+  function dateForm($field_name, $field_type, $widget_type, $todate = TRUE) {
     // Tests that date field functions properly.
     $edit = array();
     $edit['title'] = $this->randomName(8);
     $edit['body[und][0][value]'] = $this->randomName(16);
     $current_year = date('Y');
 
-    if ($options == 'date_select') {
+    if ($widget_type == '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 == 'date_text') {
+    elseif ($widget_type == 'date_text') {
       $edit['field_test[und][0][value][date]'] = format_string('10/07/!year - 10:30', array('!year' => $current_year));
     }
-    elseif ($options == 'date_popup') {
+    elseif ($widget_type == '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');
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/tests/date_validation.test b/drupal7/sites/all/modules/date/tests/DateValidationTestCase.test
similarity index 84%
rename from drupal7/sites/all/modules/date/tests/date_validation.test
rename to drupal7/sites/all/modules/date/tests/DateValidationTestCase.test
index a32ff805..d276b07f 100644
--- a/drupal7/sites/all/modules/date/tests/date_validation.test
+++ b/drupal7/sites/all/modules/date/tests/DateValidationTestCase.test
@@ -1,9 +1,14 @@
 <?php
+
 /**
  * @file
- * Date validation tests.
+ * Validate date field values.
+ */
+
+/**
+ * Validate date field values.
  */
-class DateValidationTestCase extends DateFieldBasic {
+class DateValidationTestCase extends DateFieldTestBase {
 
   /**
    * @todo.
@@ -23,27 +28,38 @@ class DateValidationTestCase extends DateFieldBasic {
     // Attempts to create text date field stored as a date with default settings
     // (from input which is not valid).
     foreach (array('date', 'datestamp', 'datetime') as $field_type) {
-      foreach (array('date_select', 'date_popup', 'date_text') as $widget_type) {
-        $field_name = 'field_test';
-        $label = 'Test';
-        $options = array(
-          'label' => $label,
-          'field_name' => $field_name,
-          'field_type' => $field_type,
-          'widget_type' => $widget_type,
-          'input_format' => 'm/d/Y - H:i',
-        );
-        $this->createDateField($options);
+      foreach (array('date_select', 'date_text') as $widget_type) {
+        $this->checkDateField($field_type, $widget_type, TRUE);
+        return;
+      }
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function checkDateField($field_type, $widget_type, $delete_when_done = TRUE) {
+    $field_name = 'field_test';
+    $label = 'Test';
+    $options = array(
+      'label' => $label,
+      'field_name' => $field_name,
+      'field_type' => $field_type,
+      'widget_type' => $widget_type,
+      'input_format' => 'm/d/Y - H:i',
+    );
+    $this->createDateField($options);
+
+    // Malformed date test won't work on date_select, which won't allow
+    // invalid input.
+    if ($widget_type != 'date_select') {
+      $this->malFormedDate($field_name, $field_type, $widget_type);
+    }
 
-        // Malformed date test won't work on date_select, which won't allow
-        // invalid input.
-        if ($widget_type != 'date_select') {
-          $this->malFormedDate($field_name, $field_type, $widget_type);
-        }
+    $this->wrongGranularity($field_name, $field_type, $widget_type);
 
-        $this->wrongGranularity($field_name, $field_type, $widget_type);
-        $this->deleteDateField($label);
-      }
+    if ($delete_when_done) {
+      $this->deleteDateField($label);
     }
   }
 
@@ -118,7 +134,6 @@ class DateValidationTestCase extends DateFieldBasic {
     $this->assertText($should_be, "Correctly blocked invalid hour for a $field_type field using the $widget_type widget.");
     $should_be = 'The minute is invalid.';
     $this->assertText($should_be, "Correctly blocked invalid minute for a $field_type field using the $widget_type widget.");
-
   }
 
   /**
@@ -148,4 +163,5 @@ class DateValidationTestCase extends DateFieldBasic {
     $this->assertNoText($should_not_be, "Correctly blocked creation of node with missing time for a $field_type field using the $widget_type widget.");
     $this->assertText('invalid', "Marked form with missing time as invalid for a $field_type field using the $widget_type widget.");
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/tests/Yahoo.csv b/drupal7/sites/all/modules/date/tests/Yahoo.csv
index 09ec9c69..672910cd 100644
--- a/drupal7/sites/all/modules/date/tests/Yahoo.csv
+++ b/drupal7/sites/all/modules/date/tests/Yahoo.csv
@@ -1,16 +1,16 @@
 "Subject","Start Date","Start Time","End Date","End Time","All day event","Description"
-"New Year's Day","1/1/2009","","","","true",""
-"Valentine's Day","2/14/2009","","","","true",""
-"St. Patrick's Day","3/17/2009","","","","true",""
-"Memorial Day","5/31/2009","","","","true",""
-"Independence Day","7/4/2009","","","","true",""
-"Labor Day","09/07/2009","","","","true",""
-"Halloween","10/31/2009","","","","true",""
-"Veteran's Day","11/11/2009","","","","true",""
-"Thanksgiving Day","11/26/2009","","","","true",""
-"Christmas Day","12/25/2009","","","","true",""
-"Do It With Drupal","12/10/2008","08:00 AM","12/10/2008","05:00 PM","false",""
-"DrupalCon","03/04/2009","08:00 AM","03/04/2009","05:00 PM","false",""
-"DrupalCon","03/05/2009","08:00 AM","03/05/2009","05:00 PM","false",""
-"DrupalCon","03/06/2009","08:00 AM","03/06/2009","05:00 PM","false",""
-"DrupalCon","03/07/2009","08:00 AM","03/07/2009","05:00 PM","false",""
+"New Year's Day","1/1/2009","","","","TRUE",""
+"Valentine's Day","2/14/2009","","","","TRUE",""
+"St. Patrick's Day","3/17/2009","","","","TRUE",""
+"Memorial Day","5/31/2009","","","","TRUE",""
+"Independence Day","7/4/2009","","","","TRUE",""
+"Labor Day","09/07/2009","","","","TRUE",""
+"Halloween","10/31/2009","","","","TRUE",""
+"Veteran's Day","11/11/2009","","","","TRUE",""
+"Thanksgiving Day","11/26/2009","","","","TRUE",""
+"Christmas Day","12/25/2009","","","","TRUE",""
+"Do It With Drupal","12/10/2008","08:00 AM","12/10/2008","05:00 PM","FALSE",""
+"DrupalCon","03/04/2009","08:00 AM","03/04/2009","05:00 PM","FALSE",""
+"DrupalCon","03/05/2009","08:00 AM","03/05/2009","05:00 PM","FALSE",""
+"DrupalCon","03/06/2009","08:00 AM","03/06/2009","05:00 PM","FALSE",""
+"DrupalCon","03/07/2009","08:00 AM","03/07/2009","05:00 PM","FALSE",""
diff --git a/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.info b/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.info
new file mode 100644
index 00000000..ba868b1e
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.info
@@ -0,0 +1,22 @@
+name = Date Migration Test Helper
+description = "Helper for the Date module's Migrate API integration."
+package = Date/Time
+version = VERSION
+core = 7.x
+hidden = TRUE
+
+; Load the Date module's test feature so there are some default data structures
+; to work with.
+dependencies[] = date:date_test_feature
+
+; Load the Migrate API system.
+dependencies[] = migrate:migrate
+
+; Load the custom Migrate API class.
+files[] = date_migrate_test.migrate.inc
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
+core = "7.x"
+project = "date"
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.install b/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.install
new file mode 100644
index 00000000..d52d07b7
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.install
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions for the Date Migrate Test module.
+ */
+
+/**
+ * Implements hook_disable().
+ */
+function date_migrate_test_disable() {
+  Migration::deregisterMigration('DateExample');
+}
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc b/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.migrate.inc
similarity index 95%
rename from drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
rename to drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.migrate.inc
index 216e1c54..c91437ce 100644
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
+++ b/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.migrate.inc
@@ -44,13 +44,13 @@ class DateExampleMigration extends XMLMigration {
     );
 
     // Our test data is in an XML file.
-    $xml_folder = drupal_get_path('module', 'date_migrate_example');
-    $items_url = $xml_folder . '/date_migrate_example.xml';
+    $xml_folder = drupal_get_path('module', 'date_migrate_test');
+    $items_url = $xml_folder . '/example_data.xml';
     $item_xpath = '/source_data/item';
     $item_id_xpath = 'id';
     $items_class = new MigrateItemsXML($items_url, $item_xpath, $item_id_xpath);
     $this->source = new MigrateSourceMultiItems($items_class, $fields);
-    $this->destination = new MigrateDestinationNode('date_migrate_example');
+    $this->destination = new MigrateDestinationNode('date_test_feature');
 
     // Basic fields.
     $this->addFieldMapping('title', 'title')
@@ -128,4 +128,5 @@ class DateExampleMigration extends XMLMigration {
     $current_row->date_repeat_rrule
       = (string) $current_row->xml->date_repeat->rule[0];
   }
+
 }
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.module b/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.module
similarity index 58%
rename from drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.module
rename to drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.module
index 2ed7a61e..d5a5e7a6 100644
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.module
+++ b/drupal7/sites/all/modules/date/tests/date_migrate_test/date_migrate_test.module
@@ -2,19 +2,17 @@
 
 /**
  * @file
- * Migration integration for Date Migrate Example.
+ * Primary hook implementations for the Date Migrate Test module.
  */
 
-include_once 'date_migrate_example.features.inc';
-
 /**
  * Implements hook_migrate_api().
  */
-function date_migrate_example_migrate_api() {
+function date_migrate_test_migrate_api() {
   $api = array(
     'api' => 2,
     'migrations' => array(
-      'DateExample' => array('class_name' => 'DateExampleMigration')
+      'DateExample' => array('class_name' => 'DateExampleMigration'),
     ),
   );
   return $api;
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.xml b/drupal7/sites/all/modules/date/tests/date_migrate_test/example_data.xml
similarity index 100%
rename from drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.xml
rename to drupal7/sites/all/modules/date/tests/date_migrate_test/example_data.xml
diff --git a/drupal7/sites/all/modules/date/tests/date_test/date_test.info b/drupal7/sites/all/modules/date/tests/date_test/date_test.info
index 2f265fa7..e92d43d6 100644
--- a/drupal7/sites/all/modules/date/tests/date_test/date_test.info
+++ b/drupal7/sites/all/modules/date/tests/date_test/date_test.info
@@ -4,11 +4,10 @@ package = Date/Time
 version = VERSION
 core = 7.x
 hidden = TRUE
-dependencies[] = date
+dependencies[] = date:date
 
-; Information added by Drupal.org packaging script on 2017-04-07
-version = "7.x-2.10"
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
 core = "7.x"
 project = "date"
-datestamp = "1491562090"
-
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/tests/date_test/date_test.module b/drupal7/sites/all/modules/date/tests/date_test/date_test.module
index 18540891..72842b5b 100644
--- a/drupal7/sites/all/modules/date/tests/date_test/date_test.module
+++ b/drupal7/sites/all/modules/date/tests/date_test/date_test.module
@@ -32,7 +32,7 @@ function date_test_sample_form($form, &$form_state) {
       'hour' => 7,
       'minute' => 0,
       'second' => 0,
-      'ampm' => 'am'
+      'ampm' => 'am',
     ),
   );
 
diff --git a/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.field_base.inc b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.field_base.inc
new file mode 100644
index 00000000..f78e11ef
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.field_base.inc
@@ -0,0 +1,271 @@
+<?php
+
+/**
+ * @file
+ * date_test_feature.features.field_base.inc
+ */
+
+/**
+ * Implements hook_field_default_field_bases().
+ */
+function date_test_feature_field_default_field_bases() {
+  $field_bases = array();
+
+  // Exported field_base: 'body'.
+  $field_bases['body'] = array(
+    'active' => 1,
+    'cardinality' => 1,
+    'deleted' => 0,
+    'entity_types' => array(
+      0 => 'node',
+    ),
+    'field_name' => 'body',
+    'indexes' => array(
+      'format' => array(
+        0 => 'format',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'text',
+    'settings' => array(),
+    'translatable' => 1,
+    'type' => 'text_with_summary',
+  );
+
+  // Exported field_base: 'field_date'.
+  $field_bases['field_date'] = array(
+    'active' => 1,
+    'cardinality' => -1,
+    'deleted' => 0,
+    'entity_types' => array(),
+    'field_name' => 'field_date',
+    'indexes' => array(
+      'value' => array(
+        0 => 'value',
+      ),
+      'value2' => array(
+        0 => 'value2',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'date',
+    'settings' => array(
+      'cache_count' => 4,
+      'cache_enabled' => 0,
+      'granularity' => array(
+        'day' => 'day',
+        'hour' => 'hour',
+        'minute' => 'minute',
+        'month' => 'month',
+        'second' => 0,
+        'year' => 'year',
+      ),
+      'repeat' => 0,
+      'timezone_db' => 'UTC',
+      'todate' => 'optional',
+      'tz_handling' => 'site',
+    ),
+    'translatable' => 0,
+    'type' => 'datetime',
+  );
+
+  // Exported field_base: 'field_date_range'.
+  $field_bases['field_date_range'] = array(
+    'active' => 1,
+    'cardinality' => -1,
+    'deleted' => 0,
+    'entity_types' => array(),
+    'field_name' => 'field_date_range',
+    'indexes' => array(
+      'value' => array(
+        0 => 'value',
+        1 => 'value2',
+      ),
+      'value2' => array(
+        0 => 'value2',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'date',
+    'settings' => array(
+      'granularity' => array(
+        'day' => 'day',
+        'hour' => 'hour',
+        'minute' => 'minute',
+        'month' => 'month',
+        'year' => 'year',
+      ),
+      'repeat' => 0,
+      'timezone_db' => 'UTC',
+      'todate' => 'required',
+      'tz_handling' => 'site',
+    ),
+    'translatable' => 1,
+    'type' => 'date',
+  );
+
+  // Exported field_base: 'field_date_repeat'.
+  $field_bases['field_date_repeat'] = array(
+    'active' => 1,
+    'cardinality' => -1,
+    'deleted' => 0,
+    'entity_types' => array(),
+    'field_name' => 'field_date_repeat',
+    'indexes' => array(
+      'value' => array(
+        0 => 'value',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'date',
+    'settings' => array(
+      'granularity' => array(
+        'day' => 'day',
+        'hour' => 'hour',
+        'minute' => 'minute',
+        'month' => 'month',
+        'year' => 'year',
+      ),
+      'repeat' => 1,
+      'timezone_db' => 'UTC',
+      'todate' => '',
+      'tz_handling' => 'site',
+    ),
+    'translatable' => 1,
+    'type' => 'date',
+  );
+
+  // Exported field_base: 'field_datestamp'.
+  $field_bases['field_datestamp'] = array(
+    'active' => 1,
+    'cardinality' => 1,
+    'deleted' => 0,
+    'entity_types' => array(),
+    'field_name' => 'field_datestamp',
+    'indexes' => array(
+      'value' => array(
+        0 => 'value',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'date',
+    'settings' => array(
+      'granularity' => array(
+        'day' => 'day',
+        'hour' => 'hour',
+        'minute' => 'minute',
+        'month' => 'month',
+        'year' => 'year',
+      ),
+      'repeat' => 0,
+      'timezone_db' => 'UTC',
+      'todate' => '',
+      'tz_handling' => 'site',
+    ),
+    'translatable' => 1,
+    'type' => 'datestamp',
+  );
+
+  // Exported field_base: 'field_datestamp_range'.
+  $field_bases['field_datestamp_range'] = array(
+    'active' => 1,
+    'cardinality' => 1,
+    'deleted' => 0,
+    'entity_types' => array(),
+    'field_name' => 'field_datestamp_range',
+    'indexes' => array(
+      'value' => array(
+        0 => 'value',
+        1 => 'value2',
+      ),
+      'value2' => array(
+        0 => 'value2',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'date',
+    'settings' => array(
+      'granularity' => array(
+        'day' => 'day',
+        'hour' => 'hour',
+        'minute' => 'minute',
+        'month' => 'month',
+        'year' => 'year',
+      ),
+      'repeat' => 0,
+      'timezone_db' => 'UTC',
+      'todate' => 'optional',
+      'tz_handling' => 'site',
+    ),
+    'translatable' => 1,
+    'type' => 'datestamp',
+  );
+
+  // Exported field_base: 'field_datetime'.
+  $field_bases['field_datetime'] = array(
+    'active' => 1,
+    'cardinality' => 1,
+    'deleted' => 0,
+    'entity_types' => array(),
+    'field_name' => 'field_datetime',
+    'indexes' => array(
+      'value' => array(
+        0 => 'value',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'date',
+    'settings' => array(
+      'granularity' => array(
+        'day' => 'day',
+        'hour' => 'hour',
+        'minute' => 'minute',
+        'month' => 'month',
+        'year' => 'year',
+      ),
+      'repeat' => 0,
+      'timezone_db' => 'UTC',
+      'todate' => '',
+      'tz_handling' => 'site',
+    ),
+    'translatable' => 1,
+    'type' => 'datetime',
+  );
+
+  // Exported field_base: 'field_datetime_range'.
+  $field_bases['field_datetime_range'] = array(
+    'active' => 1,
+    'cardinality' => 1,
+    'deleted' => 0,
+    'entity_types' => array(),
+    'field_name' => 'field_datetime_range',
+    'indexes' => array(
+      'value' => array(
+        0 => 'value',
+        1 => 'value2',
+      ),
+      'value2' => array(
+        0 => 'value2',
+      ),
+    ),
+    'locked' => 0,
+    'module' => 'date',
+    'settings' => array(
+      'granularity' => array(
+        'day' => 'day',
+        'hour' => 'hour',
+        'minute' => 'minute',
+        'month' => 'month',
+        'year' => 'year',
+      ),
+      'repeat' => 0,
+      'timezone_db' => 'UTC',
+      'todate' => 'required',
+      'tz_handling' => 'site',
+    ),
+    'translatable' => 1,
+    'type' => 'datetime',
+  );
+
+  return $field_bases;
+}
diff --git a/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.field_instance.inc b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.field_instance.inc
new file mode 100644
index 00000000..94615ec3
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.field_instance.inc
@@ -0,0 +1,485 @@
+<?php
+
+/**
+ * @file
+ * date_test_feature.features.field_instance.inc
+ */
+
+/**
+ * Implements hook_field_default_field_instances().
+ */
+function date_test_feature_field_default_field_instances() {
+  $field_instances = array();
+
+  // Exported field_instance: 'node-date_test_feature-body'.
+  $field_instances['node-date_test_feature-body'] = array(
+    'bundle' => 'date_test_feature',
+    'default_value' => NULL,
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'hidden',
+        'module' => 'text',
+        'settings' => array(),
+        'type' => 'text_default',
+        'weight' => 0,
+      ),
+      'teaser' => array(
+        'label' => 'hidden',
+        'module' => 'text',
+        'settings' => array(
+          'trim_length' => 600,
+        ),
+        'type' => 'text_summary_or_trimmed',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'body',
+    'label' => 'Body',
+    'required' => FALSE,
+    'settings' => array(
+      'display_summary' => TRUE,
+      'text_processing' => 1,
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'module' => 'text',
+      'settings' => array(
+        'rows' => 20,
+        'summary_rows' => 5,
+      ),
+      'type' => 'text_textarea_with_summary',
+      'weight' => 1,
+    ),
+  );
+
+  // Exported field_instance: 'node-date_test_feature-field_date'.
+  $field_instances['node-date_test_feature-field_date'] = array(
+    'bundle' => 'date_test_feature',
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'module' => 'date',
+        'settings' => array(
+          'custom_date_format' => '',
+          'format_type' => 'medium',
+          'fromto' => 'both',
+          'multiple_from' => '',
+          'multiple_number' => '',
+          'multiple_to' => '',
+          'show_remaining_days' => FALSE,
+          'show_repeat_rule' => 'show',
+        ),
+        'type' => 'date_default',
+        'weight' => 1,
+      ),
+      'teaser' => array(
+        'label' => 'above',
+        'settings' => array(),
+        'type' => 'hidden',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'field_date',
+    'label' => 'Date',
+    'required' => FALSE,
+    'settings' => array(
+      'default_value' => 'now',
+      'default_value2' => 'blank',
+      'default_value_code' => '',
+      'default_value_code2' => '',
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'active' => 1,
+      'module' => 'date',
+      'settings' => array(
+        'display_all_day' => 0,
+        'increment' => 1,
+        'input_format' => 'm/d/Y - H:i:s',
+        'input_format_custom' => '',
+        'label_position' => 'above',
+        'no_fieldset' => 0,
+        'repeat_collapsed' => 0,
+        'text_parts' => array(),
+        'year_range' => '-3:+3',
+      ),
+      'type' => 'date_text',
+      'weight' => 2,
+    ),
+  );
+
+  // Exported field_instance: 'node-date_test_feature-field_date_range'.
+  $field_instances['node-date_test_feature-field_date_range'] = array(
+    'bundle' => 'date_test_feature',
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'module' => 'date',
+        'settings' => array(
+          'custom_date_format' => '',
+          'format_type' => 'medium',
+          'fromto' => 'both',
+          'multiple_from' => '',
+          'multiple_number' => '',
+          'multiple_to' => '',
+          'show_remaining_days' => FALSE,
+          'show_repeat_rule' => 'show',
+        ),
+        'type' => 'date_default',
+        'weight' => 2,
+      ),
+      'teaser' => array(
+        'label' => 'above',
+        'settings' => array(),
+        'type' => 'hidden',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'field_date_range',
+    'label' => 'Date range',
+    'required' => FALSE,
+    'settings' => array(
+      'default_format' => 'medium',
+      'default_value' => 'now',
+      'default_value2' => 'strtotime',
+      'default_value_code' => '',
+      'default_value_code2' => '+7 days',
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'active' => 1,
+      'module' => 'date',
+      'settings' => array(
+        'display_all_day' => 0,
+        'increment' => 1,
+        'input_format' => 'm/d/Y - H:i:s',
+        'input_format_custom' => '',
+        'label_position' => 'above',
+        'repeat_collapsed' => 0,
+        'text_parts' => array(),
+        'year_range' => '-3:+3',
+      ),
+      'type' => 'date_text',
+      'weight' => 3,
+    ),
+  );
+
+  // Exported field_instance: 'node-date_test_feature-field_date_repeat'.
+  $field_instances['node-date_test_feature-field_date_repeat'] = array(
+    'bundle' => 'date_test_feature',
+    'default_value' => NULL,
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'module' => 'date',
+        'settings' => array(
+          'custom_date_format' => '',
+          'format_type' => 'medium',
+          'fromto' => 'both',
+          'multiple_from' => '',
+          'multiple_number' => '',
+          'multiple_to' => '',
+          'show_remaining_days' => FALSE,
+          'show_repeat_rule' => 'show',
+        ),
+        'type' => 'date_default',
+        'weight' => 7,
+      ),
+      'teaser' => array(
+        'label' => 'above',
+        'settings' => array(),
+        'type' => 'hidden',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'field_date_repeat',
+    'label' => 'Date with repeat',
+    'required' => FALSE,
+    'settings' => array(
+      'default_format' => 'medium',
+      'default_value' => 'now',
+      'default_value2' => 'blank',
+      'default_value_code' => '',
+      'default_value_code2' => '',
+      'repeat_collapsed' => 0,
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'active' => 1,
+      'module' => 'date',
+      'settings' => array(
+        'display_all_day' => 0,
+        'increment' => 1,
+        'input_format' => 'm/d/Y - H:i:s',
+        'input_format_custom' => '',
+        'label_position' => 'above',
+        'repeat_collapsed' => 0,
+        'text_parts' => array(),
+        'year_range' => '-3:+3',
+      ),
+      'type' => 'date_select',
+      'weight' => 8,
+    ),
+  );
+
+  // Exported field_instance: 'node-date_test_feature-field_datestamp'.
+  $field_instances['node-date_test_feature-field_datestamp'] = array(
+    'bundle' => 'date_test_feature',
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'module' => 'date',
+        'settings' => array(
+          'custom_date_format' => '',
+          'format_type' => 'medium',
+          'fromto' => 'both',
+          'multiple_from' => '',
+          'multiple_number' => '',
+          'multiple_to' => '',
+          'show_remaining_days' => FALSE,
+          'show_repeat_rule' => 'show',
+        ),
+        'type' => 'date_default',
+        'weight' => 3,
+      ),
+      'teaser' => array(
+        'label' => 'above',
+        'settings' => array(),
+        'type' => 'hidden',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'field_datestamp',
+    'label' => 'Datestamp',
+    'required' => FALSE,
+    'settings' => array(
+      'default_format' => 'medium',
+      'default_value' => 'now',
+      'default_value2' => 'blank',
+      'default_value_code' => '',
+      'default_value_code2' => '',
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'active' => 1,
+      'module' => 'date',
+      'settings' => array(
+        'display_all_day' => 0,
+        'increment' => 1,
+        'input_format' => 'm/d/Y - H:i:s',
+        'input_format_custom' => '',
+        'label_position' => 'above',
+        'repeat_collapsed' => 0,
+        'text_parts' => array(),
+        'year_range' => '-3:+3',
+      ),
+      'type' => 'date_text',
+      'weight' => 4,
+    ),
+  );
+
+  // Exported field_instance: 'node-date_test_feature-field_datestamp_range'.
+  $field_instances['node-date_test_feature-field_datestamp_range'] = array(
+    'bundle' => 'date_test_feature',
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'module' => 'date',
+        'settings' => array(
+          'custom_date_format' => '',
+          'format_type' => 'medium',
+          'fromto' => 'both',
+          'multiple_from' => '',
+          'multiple_number' => '',
+          'multiple_to' => '',
+          'show_remaining_days' => FALSE,
+          'show_repeat_rule' => 'show',
+        ),
+        'type' => 'date_default',
+        'weight' => 4,
+      ),
+      'teaser' => array(
+        'label' => 'above',
+        'settings' => array(),
+        'type' => 'hidden',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'field_datestamp_range',
+    'label' => 'Datestamp range',
+    'required' => FALSE,
+    'settings' => array(
+      'default_format' => 'medium',
+      'default_value' => 'now',
+      'default_value2' => 'strtotime',
+      'default_value_code' => '',
+      'default_value_code2' => '+3 months',
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'active' => 1,
+      'module' => 'date',
+      'settings' => array(
+        'display_all_day' => 0,
+        'increment' => 1,
+        'input_format' => 'm/d/Y - H:i:s',
+        'input_format_custom' => '',
+        'label_position' => 'above',
+        'repeat_collapsed' => 0,
+        'text_parts' => array(),
+        'year_range' => '-3:+3',
+      ),
+      'type' => 'date_select',
+      'weight' => 5,
+    ),
+  );
+
+  // Exported field_instance: 'node-date_test_feature-field_datetime'.
+  $field_instances['node-date_test_feature-field_datetime'] = array(
+    'bundle' => 'date_test_feature',
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'module' => 'date',
+        'settings' => array(
+          'custom_date_format' => '',
+          'format_type' => 'medium',
+          'fromto' => 'both',
+          'multiple_from' => '',
+          'multiple_number' => '',
+          'multiple_to' => '',
+          'show_remaining_days' => FALSE,
+          'show_repeat_rule' => 'show',
+        ),
+        'type' => 'date_default',
+        'weight' => 5,
+      ),
+      'teaser' => array(
+        'label' => 'above',
+        'settings' => array(),
+        'type' => 'hidden',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'field_datetime',
+    'label' => 'Datetime',
+    'required' => FALSE,
+    'settings' => array(
+      'default_format' => 'medium',
+      'default_value' => 'now',
+      'default_value2' => 'blank',
+      'default_value_code' => '',
+      'default_value_code2' => '',
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'active' => 1,
+      'module' => 'date',
+      'settings' => array(
+        'display_all_day' => 0,
+        'increment' => 1,
+        'input_format' => 'm/d/Y - H:i:s',
+        'input_format_custom' => '',
+        'label_position' => 'above',
+        'repeat_collapsed' => 0,
+        'text_parts' => array(),
+        'year_range' => '-3:+3',
+      ),
+      'type' => 'date_text',
+      'weight' => 6,
+    ),
+  );
+
+  // Exported field_instance: 'node-date_test_feature-field_datetime_range'.
+  $field_instances['node-date_test_feature-field_datetime_range'] = array(
+    'bundle' => 'date_test_feature',
+    'deleted' => 0,
+    'description' => '',
+    'display' => array(
+      'default' => array(
+        'label' => 'above',
+        'module' => 'date',
+        'settings' => array(
+          'custom_date_format' => '',
+          'format_type' => 'medium',
+          'fromto' => 'both',
+          'multiple_from' => '',
+          'multiple_number' => '',
+          'multiple_to' => '',
+          'show_remaining_days' => FALSE,
+          'show_repeat_rule' => 'show',
+        ),
+        'type' => 'date_default',
+        'weight' => 6,
+      ),
+      'teaser' => array(
+        'label' => 'above',
+        'settings' => array(),
+        'type' => 'hidden',
+        'weight' => 0,
+      ),
+    ),
+    'entity_type' => 'node',
+    'field_name' => 'field_datetime_range',
+    'label' => 'Datetime range',
+    'required' => FALSE,
+    'settings' => array(
+      'default_format' => 'medium',
+      'default_value' => 'now',
+      'default_value2' => '+1 week',
+      'default_value_code' => '',
+      'default_value_code2' => '+1 year',
+      'user_register_form' => FALSE,
+    ),
+    'widget' => array(
+      'active' => 1,
+      'module' => 'date',
+      'settings' => array(
+        'display_all_day' => 0,
+        'increment' => 1,
+        'input_format' => 'm/d/Y - H:i:s',
+        'input_format_custom' => '',
+        'label_position' => 'above',
+        'repeat_collapsed' => 0,
+        'text_parts' => array(),
+        'year_range' => '-3:+3',
+      ),
+      'type' => 'date_text',
+      'weight' => 7,
+    ),
+  );
+
+  // Translatables
+  // Included for use with string extractors like potx.
+  t('Body');
+  t('Date');
+  t('Date range');
+  t('Date with repeat');
+  t('Datestamp');
+  t('Datestamp range');
+  t('Datetime');
+  t('Datetime range');
+
+  return $field_instances;
+}
diff --git a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.features.inc b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.inc
similarity index 64%
rename from drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.features.inc
rename to drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.inc
index 34b15d2c..215c035e 100644
--- a/drupal7/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.features.inc
+++ b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.features.inc
@@ -2,16 +2,16 @@
 
 /**
  * @file
- * Examples and test folder for migration into date fields.
+ * date_test_feature.features.inc
  */
 
 /**
  * Implements hook_node_info().
  */
-function date_migrate_example_node_info() {
+function date_test_feature_node_info() {
   $items = array(
-    'date_migrate_example' => array(
-      'name' => t('Migrate example - dates'),
+    'date_test_feature' => array(
+      'name' => t('Date Test'),
       'base' => 'node_content',
       'description' => t('This content type is used for demonstrating and testing migration into Date fields.'),
       'has_title' => '1',
@@ -19,5 +19,6 @@ function date_migrate_example_node_info() {
       'help' => '',
     ),
   );
+  drupal_alter('node_info', $items);
   return $items;
 }
diff --git a/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.info b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.info
new file mode 100644
index 00000000..57996e8f
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.info
@@ -0,0 +1,34 @@
+name = Date Test Feature
+description = Examples of migrating with the Date module, primarily for use with tests.
+core = 7.x
+package = Date/Time
+hidden = TRUE
+version = VERSION
+dependencies[] = date:date
+dependencies[] = date:date_repeat
+dependencies[] = date:date_repeat_field
+dependencies[] = features:features
+features[features_api][] = api:2
+features[field_base][] = body
+features[field_base][] = field_date
+features[field_base][] = field_date_range
+features[field_base][] = field_date_repeat
+features[field_base][] = field_datestamp
+features[field_base][] = field_datestamp_range
+features[field_base][] = field_datetime
+features[field_base][] = field_datetime_range
+features[field_instance][] = node-date_test_feature-body
+features[field_instance][] = node-date_test_feature-field_date
+features[field_instance][] = node-date_test_feature-field_date_range
+features[field_instance][] = node-date_test_feature-field_date_repeat
+features[field_instance][] = node-date_test_feature-field_datestamp
+features[field_instance][] = node-date_test_feature-field_datestamp_range
+features[field_instance][] = node-date_test_feature-field_datetime
+features[field_instance][] = node-date_test_feature-field_datetime_range
+features[node][] = date_test_feature
+
+; Information added by Drupal.org packaging script on 2021-03-05
+version = "7.x-2.11"
+core = "7.x"
+project = "date"
+datestamp = "1614952728"
diff --git a/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.install b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.install
new file mode 100644
index 00000000..7c990c85
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.install
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions for the Date Test Feature module.
+ */
+
+/**
+ * Implements hook_uninstall().
+ */
+function date_test_feature_uninstall() {
+  node_type_delete('date_test_feature');
+  variable_del('node_preview_date_test_feature');
+  node_types_rebuild();
+  menu_rebuild();
+}
diff --git a/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.module b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.module
new file mode 100644
index 00000000..1a1e306a
--- /dev/null
+++ b/drupal7/sites/all/modules/date/tests/date_test_feature/date_test_feature.module
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * Migration integration for Date Migrate Example.
+ */
+
+include_once 'date_test_feature.features.inc';
