diff --git a/core/modules/views/config/views.view.glossary.yml b/core/modules/views/config/views.view.glossary.yml index 966da7c..4d0d274 100644 --- a/core/modules/views/config/views.view.glossary.yml +++ b/core/modules/views/config/views.view.glossary.yml @@ -47,7 +47,7 @@ display: table: node field: changed label: 'Last update' - date_format: large + date_format: system_long arguments: title: id: title diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php index e67614e..8424dbc 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -742,13 +742,7 @@ public function getSQLDateField() { * Figure out what timezone we're in; needed for some date manipulations. */ public static function getTimezone() { - global $user; - if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) { - $timezone = $user->timezone; - } - else { - $timezone = variable_get('date_default_timezone', 0); - } + $timezone = drupal_get_user_timezone(); // set up the database timezone $db_type = Database::getConnection()->databaseType(); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php index dd5f2fa..e898593 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php @@ -33,9 +33,9 @@ protected function defineOptions() { public function buildOptionsForm(&$form, &$form_state) { $date_formats = array(); - $date_types = system_get_date_types(); - foreach ($date_types as $key => $value) { - $date_formats[$value['type']] = check_plain(t($value['title'] . ' format')) . ': ' . format_date(REQUEST_TIME, $value['type']); + $date_types = system_get_date_formats(); + foreach ($date_types as $machine_name => $value) { + $date_formats[$machine_name] = check_plain(t('@name format', array('@name' => $value['name'])) . ': ' . format_date(REQUEST_TIME, $machine_name)); } $form['date_format'] = array( diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldDateTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldDateTest.php index 6040d40..f243b72 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldDateTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldDateTest.php @@ -56,10 +56,10 @@ public function testFieldDate() { ); foreach ($timezones as $timezone) { $dates = array( - 'small' => format_date($time, 'small', '', $timezone), - 'medium' => format_date($time, 'medium', '', $timezone), - 'large' => format_date($time, 'large', '', $timezone), - 'custom' => format_date($time, 'custom', 'c', $timezone), + 'small' => format_date($time, 'system_small', '', $timezone), + 'medium' => format_date($time, 'system_medium', '', $timezone), + 'large' => format_date($time, 'system_large', '', $timezone), + 'custom' => format_date($time, 'system_custom', 'c', $timezone), ); $this->assertRenderedDatesEqual($view, $dates, $timezone); }