git.iko.soy/typeable/pandoc
on master help sign in
Docx Writer: Use actual creation time as doc prop

Previously, we had used the user-supplied date, if available, for Word's document creation metadata. This could lead to weird results, as in cases where the user post-dates a document (so the modification might be prior to the creation). Here we use the actual computer time to set the document creation.

commitf529fc17efff60b5ba32cb8c82aef356a84c3d3d authorJesse Rosenthal <jrosenthal@jhu.edu> dateSun 10 Jul 2016, 09:57 (10 years ago) parente8e02f1
1 file changed+3−4
src/Text/Pandoc/Writers/Docx.hs+3−4
src/Text/Pandoc/Writers/Docx.hs+3−4
@@ -440,10 +440,9 @@ writeDocx opts doc@(Pandoc meta _) = do
440440 ,("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance")]
441441 $ mknode "dc:title" [] (stringify $ docTitle meta)
442442 : mknode "dc:creator" [] (intercalate "; " (map stringify $ docAuthors meta))
443− : maybe []
444− (\x -> [ mknode "dcterms:created" [("xsi:type","dcterms:W3CDTF")] x
445− , mknode "dcterms:modified" [("xsi:type","dcterms:W3CDTF")] x
446− ]) (normalizeDate $ stringify $ docDate meta)
443+ : (\x -> [ mknode "dcterms:created" [("xsi:type","dcterms:W3CDTF")] x
444+ , mknode "dcterms:modified" [("xsi:type","dcterms:W3CDTF")] x
445+ ]) (formatTime defaultTimeLocale "%FT%XZ" utctime)
447446 let docPropsEntry = toEntry docPropsPath epochtime $ renderXml docProps
448447
449448 let relsPath = "_rels/.rels"