Skip to content

Commit 1894ded

Browse files
catch error if php intl extension is not available
1 parent 266536a commit 1894ded

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

includes/ttxweb_decoder.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,14 @@ function renderRow0() {
610610

611611
$myDate = new DateTime();
612612

613-
$formatter = new IntlDateFormatter($ttxLanguage, IntlDateFormatter::FULL, IntlDateFormatter::FULL);
614-
$formatter->setPattern('EEEEEE');
615-
$myWeekDay = substr($formatter->format($myDate), 0, 2);
613+
if (class_exists('IntlDateFormatter')) {
614+
$formatter = new IntlDateFormatter($ttxLanguage, IntlDateFormatter::FULL, IntlDateFormatter::FULL);
615+
$formatter->setPattern('EEEEEE');
616+
$myWeekDay = substr($formatter->format($myDate), 0, 2);
617+
}
618+
else {
619+
$myWeekDay = substr($myDate->format('D'), 0, 2);
620+
}
616621

617622
$myMonth = str_pad($myDate->format('m'), 2, '0', STR_PAD_LEFT);
618623
$myDay = str_pad($myDate->format('d'), 2, '0', STR_PAD_LEFT);

0 commit comments

Comments
 (0)