protected function DateRecurDefaultRSet::_fixDates in Recurring Dates Field 8
2 calls to DateRecurDefaultRSet::_fixDates()
File
- src/
DateRecurDefaultRSet.php, line 58
Class
Namespace
Drupal\date_recurCode
protected function _fixDates($datestr) {
if (is_string($datestr) && strpos($datestr, ',')) {
$dates = explode(',', $datestr);
}
else {
$dates = [
$datestr,
];
}
/** @var \DateTime $dtstart */
$dtstart = $this
->getStartDate();
foreach ($dates as $key => $datestr) {
$date = RRule::parseDate($datestr);
if ($dtstart) {
$date
->setTimezone($dtstart
->getTimezone());
$date
->setTime($dtstart
->format('H'), $dtstart
->format('i'));
}
$dates[$key] = $date;
}
return $dates;
}