diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-07-10 09:57:26 -0400 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-07-14 17:02:30 -0400 |
commit | f529fc17efff60b5ba32cb8c82aef356a84c3d3d (patch) | |
tree | 1897fe9622195e9078148631b3e9ba2fd06ba065 /src/Text/Pandoc | |
parent | e8e02f122089588d11d5f42663a3a0c6aab50f9b (diff) | |
download | pandoc-f529fc17efff60b5ba32cb8c82aef356a84c3d3d.tar.gz |
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.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 8cfe24199..c175fbaf2 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -440,10 +440,9 @@ writeDocx opts doc@(Pandoc meta _) = do ,("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance")] $ mknode "dc:title" [] (stringify $ docTitle meta) : mknode "dc:creator" [] (intercalate "; " (map stringify $ docAuthors meta)) - : maybe [] - (\x -> [ mknode "dcterms:created" [("xsi:type","dcterms:W3CDTF")] x - , mknode "dcterms:modified" [("xsi:type","dcterms:W3CDTF")] x - ]) (normalizeDate $ stringify $ docDate meta) + : (\x -> [ mknode "dcterms:created" [("xsi:type","dcterms:W3CDTF")] x + , mknode "dcterms:modified" [("xsi:type","dcterms:W3CDTF")] x + ]) (formatTime defaultTimeLocale "%FT%XZ" utctime) let docPropsEntry = toEntry docPropsPath epochtime $ renderXml docProps let relsPath = "_rels/.rels" |