- Issue created by @mkindred
- πΊπΈUnited States micahw156
I see two ways to fix this problem. The first is a quick fix to add the
@
character before the integer value when creating a new\DateTime()
object.diff --git a/src/DateICal.php b/src/DateICal.php index 5610597..d35cb67 100644 --- a/src/DateICal.php +++ b/src/DateICal.php @@ -43,7 +43,7 @@ class DateICal implements DateICalInterface { $end = $field['end_field']['value']; } if (is_numeric($start)) { - $start = new \DateTime($start, $dateUTCTimeZone); + $start = new \DateTime("@$start", $dateUTCTimeZone); } else { if (strlen($start) === 10) { @@ -58,7 +58,7 @@ class DateICal implements DateICalInterface { if (!empty($end)) { if (is_numeric($end)) { - $end = new \DateTime($end, $dateUTCTimeZone); + $end = new \DateTime("@$end", $dateUTCTimeZone); } else { if (strlen($end) === 10) {
It would also be possible to fix this by implementing
DrupalDateTimePlus
, but that seems like a bad idea unless converting the entire service to use this approach. - π«π·France lazzyvn paris
Actually, from beginning, I did not intend to support the smart date module because its data storage structure is completely different from date time and date rage module in drupal core. After supporting smart date, a series of timezone problems appeared, so in the new version, I was forced to prioritize standard drupal fields than supporting smartdate. You can go back last version or wait new version
-
lazzyvn β
committed 4d60181f on 4.x
Issue #3534022: Smart date range stopped working with 4.0.11
-
lazzyvn β
committed 4d60181f on 4.x
Automatically closed - issue fixed for 2 weeks with no activity.