Set time in autotranslater's use of IntlCalendar to prevent issues with

DST
This commit is contained in:
Joshua Ramon Enslin 2022-09-13 10:58:38 +02:00
parent a1ef24afba
commit 7c0ad9fa37
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -567,6 +567,10 @@ final class NodaTimeAutotranslater {
$dateGeneral->set(IntlCalendar::FIELD_DAY_OF_MONTH, (int)$timeInfo['zeit_zaehlzeit_tag']);
}
// Set time to noon, so that time zones or DST will not make a difference
$dateGeneral->set(IntlCalendar::FIELD_AM_PM, 0); // 0: AM, 1: PM
$dateGeneral->set(IntlCalendar::FIELD_HOUR, 11);
$format = match($usecase) {
NodaTimeAutotranslaterUseCase::MONTH => $tLang->formatYearMonthForIntlDateFormatter(),
default => $tLang->formatFullDateForIntlDateFormatter(),