Small tweak to xlsx support to format the date properly. (#3025)

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
AT 2024-10-03 13:34:30 -04:00 committed by GitHub
parent cd3d06c6db
commit 767189d770
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,9 +30,9 @@ static QString formatCellText(const QXlsx::Cell *cell)
QString cellText;
// Determine the cell type based on format
if (format.isDateTimeFormat()) {
if (cell->isDateTime()) {
// Handle DateTime
QDateTime dateTime = value.toDateTime();
QDateTime dateTime = cell->dateTime().toDateTime();
cellText = dateTime.isValid() ? dateTime.toString("yyyy-MM-dd") : value.toString();
} else {
cellText = value.toString();