diff --git a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php index 9673c9c65caa57848d87ed6b4bdd3e2772aa4741..3707bf88a38be0eb4803334c38004805fac6232a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php @@ -36,6 +36,20 @@ public function setUp() { } + /** + * Test that the AJAX Timezone Callback can deal with various formats. + */ + public function testSystemTimezone() { + $options = array( + 'query' => array( + 'date' => 'Tue+Sep+17+2013+21%3A35%3A31+GMT%2B0100+(BST)#', + ) + ); + // Query the AJAX Timezone Callback with a long-format date. + $response = $this->drupalGet('system/timezone/BST/3600/1', $options); + $this->assertEqual($response, '"Europe\/London"', 'Timezone AJAX callback successfully identifies and responds to a long-format date.'); + } + /** * Test that DrupalDateTime can detect the right timezone to use. * Test with a variety of less commonly used timezone names to diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index d759cf313975ab61e2de351d79ac800a2882aadb..4d1c90ac29f171b4ee56825d091fa1dd5a34bc6f 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -344,9 +344,12 @@ system.modules_uninstall_confirm: _permission: 'administer modules' system.timezone: - path: '/system/timezone' + path: '/system/timezone/{abbreviation}/{offset}/{is_daylight_saving_time}' defaults: _controller: '\Drupal\system\Controller\TimezoneController::getTimezone' + abbreviation: '' + offset: -1 + is_daylight_saving_time: NULL requirements: _access: 'TRUE'