Commit 6f3f6fb3 authored by alexpott's avatar alexpott

Issue #3035318 by mpdonadio: `DateFormatter()` assumes 30 days per month,...

Issue #3035318 by mpdonadio: `DateFormatter()` assumes 30 days per month, while February only has 28 days.  Causes fails in tests

(cherry picked from commit bdfafab7)
parent b5e3c441
......@@ -110,13 +110,13 @@ public function testSettings() {
$edit = [
'fields[field_datetime][settings_edit_form][settings][future_format]' => 'ends in @interval',
'fields[field_datetime][settings_edit_form][settings][past_format]' => 'started @interval ago',
'fields[field_datetime][settings_edit_form][settings][granularity]' => 3,
'fields[field_datetime][settings_edit_form][settings][granularity]' => 1,
];
$this->drupalPostForm(NULL, $edit, 'Update');
$this->drupalPostForm(NULL, [], 'Save');
$this->assertSession()->pageTextContains('ends in 1 year 1 month 1 week');
$this->assertSession()->pageTextContains('started 1 year 1 month 1 week ago');
$this->assertSession()->pageTextContains('ends in 1 year');
$this->assertSession()->pageTextContains('started 1 year ago');
}
}
......@@ -110,13 +110,13 @@ public function testSettings() {
$edit = [
'fields[field_timestamp][settings_edit_form][settings][future_format]' => 'ends in @interval',
'fields[field_timestamp][settings_edit_form][settings][past_format]' => 'started @interval ago',
'fields[field_timestamp][settings_edit_form][settings][granularity]' => 3,
'fields[field_timestamp][settings_edit_form][settings][granularity]' => 1,
];
$this->drupalPostForm(NULL, $edit, 'Update');
$this->drupalPostForm(NULL, [], 'Save');
$this->assertSession()->pageTextContains('ends in 1 year 1 month 1 week');
$this->assertSession()->pageTextContains('started 1 year 1 month 1 week ago');
$this->assertSession()->pageTextContains('ends in 1 year');
$this->assertSession()->pageTextContains('started 1 year ago');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment