Skip to content
Snippets Groups Projects
Commit b244c044 authored by thijsvdanker's avatar thijsvdanker Committed by Chris Leppanen
Browse files

Issue #1058424 by thijsvdanker: Port date mapper patch to d7 version to...

Issue #1058424 by thijsvdanker: Port date mapper patch to d7 version to support dates before 13 Dec 1901
parent b4eab5ab
No related branches found
No related tags found
No related merge requests found
......@@ -610,7 +610,7 @@ class FeedsDateTime extends DateTime {
$time = str_replace("GMT+", "+", $time);
// Some PHP 5.2 version's DateTime class chokes on invalid dates.
if (!strtotime($time)) {
if (!date_create($time)) {
$time = 'now';
}
......
......@@ -43,6 +43,11 @@ class FeedsDateTimeTest extends FeedsWebTestCase {
$date1 = new FeedsDateTime(2012);
$date2 = new FeedsDateTime('January 2012');
$this->assertEqual($date1->format('U'), $date2->format('U'));
// Check that years before 1902 work correctly.
$early_date_string = '01/02/1901';
$date = new FeedsDateTime($early_date_string);
$this->assertEqual($date->format('m/d/Y'), $early_date_string);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment