Commit f1182d0b authored by Rebecca Blundell's avatar Rebecca Blundell Committed by Robert Lyon
Browse files

Bug 1714408: Fix whitespace error in date format

Remove default date format and require it to be passed in.
Reinstate if statement which now runs if the date format is not found
in the langconfig.php file.

Also fix format in the modified_date.feature file so the test works
for single digit dates.

Change-Id: I532e8db518a34e803c47d9192fd9cc74231d3999
parent 102a042b
...@@ -1433,14 +1433,12 @@ JS; ...@@ -1433,14 +1433,12 @@ JS;
/** /**
* Takes a date in a format strtotime() can take and looks for it * Takes a date in a format strtotime() can take and looks for it
* in the specified css element. The default format searched for is * in the specified css element. You can pass a date format as a string
* dd Month YYYY, hh:mm AM/PM. You can pass another format as a string
* defined in langconfig.php or directly as a php date() format. * defined in langconfig.php or directly as a php date() format.
* *
* @Then I should see the date :date in the :element element
* @Then I should see the date :date in the :element element with the format :format * @Then I should see the date :date in the :element element with the format :format
*/ */
public function i_should_see_date($date, $element, $format = 'strftimedatetime') { public function i_should_see_date($date, $element, $format = null) {
if (string_exists($format, 'langconfig')) { if (string_exists($format, 'langconfig')) {
$date = format_date(strtotime($date), $format); $date = format_date(strtotime($date), $format);
} }
......
...@@ -34,4 +34,4 @@ Scenario: Adding collection to group (Bug 1448807) ...@@ -34,4 +34,4 @@ Scenario: Adding collection to group (Bug 1448807)
And I choose "Groups" from main menu And I choose "Groups" from main menu
And I follow "group 01" And I follow "group 01"
# the formats "strftimedate" and "j F Y" both resolve to dd Month YYYY, which is wanted here. # the formats "strftimedate" and "j F Y" both resolve to dd Month YYYY, which is wanted here.
And I should see the date "today" in the "#sharedcollectionlist" element with the format "strftimedate" And I should see the date "today" in the "#sharedcollectionlist" element with the format "d F Y"
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