Release 2.9.0 (#4526)
* added fix to work around bc break in new phpword version * fix phpoffice deprecations * mark unused option as deprecated * support for DateTimeInterface and DateTimeImmutable where possible * use TRUSTED_PROXIES setting - fixes #4533 * re-enable Kimai test in docker test build script (#4541) * bump dependencies
This commit is contained in:
@@ -186,7 +186,7 @@ abstract class AbstractSpreadsheetRenderer
|
||||
|
||||
$sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), $excelDate);
|
||||
// TODO why is that format hardcoded and does not depend on the users locale?
|
||||
$sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_YYYYMMDD2);
|
||||
$sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_YYYYMMDD);
|
||||
}
|
||||
|
||||
protected function setDurationTotal(Worksheet $sheet, int $column, int $row, string $startCoordinate, string $endCoordinate): void
|
||||
|
||||
@@ -24,11 +24,11 @@ final class DateFormatter implements CellFormatterInterface
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$value instanceof \DateTime) {
|
||||
throw new \InvalidArgumentException('Unsupported value given, only DateTime is supported');
|
||||
if (!$value instanceof \DateTimeInterface) {
|
||||
throw new \InvalidArgumentException('Unsupported value given, only DateTimeInterface is supported');
|
||||
}
|
||||
|
||||
$sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), Date::PHPToExcel($value));
|
||||
$sheet->getStyleByColumnAndRow($column, $row)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_YYYYMMDD2);
|
||||
$sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_YYYYMMDD);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ final class DateTimeFormatter implements CellFormatterInterface
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$value instanceof \DateTime) {
|
||||
throw new \InvalidArgumentException('Unsupported value given, only DateTime is supported');
|
||||
if (!$value instanceof \DateTimeInterface) {
|
||||
throw new \InvalidArgumentException('Unsupported value given, only DateTimeInterface is supported');
|
||||
}
|
||||
|
||||
$sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), Date::PHPToExcel($value));
|
||||
$sheet->getStyleByColumnAndRow($column, $row)->getNumberFormat()->setFormatCode(self::DATETIME_FORMAT);
|
||||
$sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(self::DATETIME_FORMAT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ final class TimeFormatter implements CellFormatterInterface
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$value instanceof \DateTime) {
|
||||
throw new \InvalidArgumentException('Unsupported value given, only DateTime is supported');
|
||||
if (!$value instanceof \DateTimeInterface) {
|
||||
throw new \InvalidArgumentException('Unsupported value given, only DateTimeInterface is supported');
|
||||
}
|
||||
|
||||
$sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), Date::PHPToExcel($value));
|
||||
|
||||
Reference in New Issue
Block a user