patched DateRangeFormatter to localized single date
This commit is contained in:
+3
-2
@@ -63,7 +63,6 @@ class DateRangeFormatterRangeFormatter extends DateTimeCustomFormatter {
|
||||
if (date('d.m.Y', $start_date) === date('d.m.Y', $end_date)) {
|
||||
$format = $this->getSetting('one_day');
|
||||
}
|
||||
|
||||
$date_str = format_date($start_date, 'custom', preg_replace('/\{([a-zA-Z])\}/', '{\\\$1}', t($format)));
|
||||
$matches = array();
|
||||
if (preg_match_all('/\{([a-zA-Z])\}/', $date_str, $matches)) {
|
||||
@@ -75,7 +74,9 @@ class DateRangeFormatterRangeFormatter extends DateTimeCustomFormatter {
|
||||
|
||||
}
|
||||
else {
|
||||
$elements[$delta] = ['#markup' => date($this->getSetting('one_day'), $start_date)];
|
||||
$format = $this->getSetting('one_day');
|
||||
$date_str = format_date($start_date, 'custom', $format);
|
||||
$elements[$delta] = ['#markup' => $date_str];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user