summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2024-08-15 02:28:19 +0200
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-15 10:50:46 +0200
commit17379f401118519670525e319fe7b69b255076b8 (patch)
tree42fda7a92a17003e4bacdaabe8d22d593e504a78 /sc
parentb37e4b02102e075b3ac0d49f45019e8590157cc3 (diff)
fixed tdf#162471: display comment dates in ods if available
Change-Id: I2fe2621458608a2bf6c382397ec5acdaeffe3748 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171882 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 6c739dc42304..252235c7abd1 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -918,7 +918,14 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos)
if (rXMLImport.GetMM100UnitConverter().convertDateTime(fDate, mxAnnotationData->maCreateDate))
{
SvNumberFormatter* pNumForm = pDoc->GetFormatTable();
- sal_uInt32 nfIndex = pNumForm->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM );
+
+ // Date string is in format ISO 8601 inside <dc:date>
+ // i.e: 2024-08-14 or 2024-08-14T23:55:06 or 20240814T235506
+ // Time always has prefix 'T'
+ sal_uInt32 nfIndex = pNumForm->GetFormatIndex(
+ mxAnnotationData->maCreateDate.indexOf('T') > -1 ? NF_DATETIME_SYS_DDMMYYYY_HHMMSS
+ : NF_DATE_SYS_DDMMYYYY,
+ LANGUAGE_SYSTEM);
OUString aDate;
const Color* pColor = nullptr;
pNumForm->GetOutputString( fDate, nfIndex, aDate, &pColor );