-
Our software is designed to track work hours, so we need to generate Excel files that includes negative time values. According to the PhpSpreadsheet documentation:
In version 1.19, we resolved this issue by configuring the following setting:
Recently we upgraded to version 2.2 and this configuration no longer works. Is there any alternative solution? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This appears to have been an oversight from when we added the ability to set the calendar by spreadsheet rather than globally. You should still be able to get the result you want as follows: if (method_exists($spreadsheet, 'setExcelCalendar')) {
$spreadsheet->setExcelCalendar(Date::CALENDAR_MAC_1904);
} else {
Date::setExcelCalendar(Date::CALENDAR_MAC_1904);
} What a horrible kludge for MS to have inflicted on its users. |
Beta Was this translation helpful? Give feedback.
This appears to have been an oversight from when we added the ability to set the calendar by spreadsheet rather than globally. You should still be able to get the result you want as follows:
What a horrible kludge for MS to have inflicted on its users.