summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/util-prs.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/util-prs.lua')
-rw-r--r--tex/context/base/mkiv/util-prs.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/util-prs.lua b/tex/context/base/mkiv/util-prs.lua
index 204611dbe..6c2a15adf 100644
--- a/tex/context/base/mkiv/util-prs.lua
+++ b/tex/context/base/mkiv/util-prs.lua
@@ -806,11 +806,20 @@ local pattern = Cf( Ct("") *
( Cg(Cc("day") * cardinal)
* S("-/") * Cg(Cc("month") * cardinal)
* S("-/") * Cg(Cc("year") * p_year)
+ ) +
+ ( Cg(Cc("year") * p_year)
+ * S("-/") * Cg(Cc("month") * cardinal)
+ ) +
+ ( Cg(Cc("month") * cardinal)
+ * S("-/") * Cg(Cc("year") * p_year)
)
)
- * P(" ") * Cg(Cc("hour") * cardinal)
+ * (
+ P(" ") * Cg(Cc("hour") * cardinal)
* P(":") * Cg(Cc("min") * cardinal)
* (P(":") * Cg(Cc("sec") * cardinal))^-1
+ + P(-1) )
+
, rawset)
lpegpatterns.splittime = pattern
@@ -819,6 +828,8 @@ function parsers.totime(str)
return lpegmatch(pattern,str)
end
+-- inspect(parsers.totime("2019-03-05"))
+-- inspect(parsers.totime("2019-03-05 12:12:12"))
-- print(os.time(parsers.totime("2019-03-05 12:12:12")))
-- print(os.time(parsers.totime("2019/03/05 12:12:12")))
-- print(os.time(parsers.totime("05-03-2019 12:12:12")))