Skip to content

Commit

Permalink
Fix Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gevorgmansuryan committed Jan 13, 2025
1 parent c512828 commit fd9cd84
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions models/forms/CalendarEntryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,4 +564,19 @@ public function getEndDateTime()
}
return $endDT;
}

private function normalizeFormattedDate($formattedDate)
{
/**
* If the locale is 'bg' (Bulgarian), remove the 'г.' suffix from the date string.
* This suffix is automatically added by IntlDateFormatter::format() to indicate "year" in Bulgarian,
* but IntlDateFormatter::parse() fails to handle it properly, causing a parsing error.
* To ensure successful parsing, we normalize the date string by removing 'г.'.
*/
if (Yii::$app->formatter->locale === 'bg') {
return str_replace(' г.', '', $formattedDate);
}

return $formattedDate;
}
}

0 comments on commit fd9cd84

Please sign in to comment.