diff core/lib/Drupal/Component/Datetime/DateTimePlus.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 7a779792577d
children c2387f117808
line wrap: on
line diff
--- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php	Mon Apr 23 09:46:53 2018 +0100
@@ -280,7 +280,7 @@
    *   parameter and the current timezone are ignored when the $time parameter
    *   either is a UNIX timestamp (e.g. @946684800) or specifies a timezone
    *   (e.g. 2010-01-28T15:00:00+02:00).
-   *   @see http://php.net/manual/en/datetime.construct.php
+   *   @see http://php.net/manual/datetime.construct.php
    * @param array $settings
    *   (optional) Keyed array of settings. Defaults to empty array.
    *   - langcode: (optional) String two letter language code used to control
@@ -704,4 +704,15 @@
     return $value;
   }
 
+  /**
+   * Sets the default time for an object built from date-only data.
+   *
+   * The default time for a date without time can be anything, so long as it is
+   * consistently applied. If we use noon, dates in most timezones will have the
+   * same value for in both the local timezone and UTC.
+   */
+  public function setDefaultDateTime() {
+    $this->dateTimeObject->setTime(12, 0, 0);
+  }
+
 }