aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-12-23 13:35:27 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2017-12-23 13:43:22 +0100
commit2c66a42ab81d40e771eda0f054c62f22ad45f3d0 (patch)
treede174a57e5cfc34dd85a1ae5304c302f1da1dbff /doc
parent35f0567a8fe840ca65f8474d0293942c76a1220f (diff)
downloadpandoc-2c66a42ab81d40e771eda0f054c62f22ad45f3d0.tar.gz
Lua modules: add function pandoc.utils.normalize_date
The function parses a date and converts it (if possible) to "YYYY-MM-DD" format.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua-filters.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 4411e90a5..7c0e83ee8 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -1433,6 +1433,17 @@ Lua functions for pandoc scripts.
This module exposes internal pandoc functions and utility
functions.
+[`normalize_date (date_string)`]{#utils-normalize_date}
+
+: Parse a date and convert (if possible) to "YYYY-MM-DD"
+ format. We limit years to the range 1601-9999 (ISO 8601
+ accepts greater than or equal to 1583, but MS Word only
+ accepts dates starting 1601).
+
+ Returns:
+
+ - A date string, or nil when the conversion failed.
+
[`sha1 (contents)`]{#utils-sha1}
: Returns the SHA1 has of the contents.