From 097dad21528bc1ad5a536a050c11a70152bc813d Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Mon, 16 Sep 2013 22:05:29 +0200 Subject: [PATCH] fixed bad patterns for 5.2 updated rockspec for 2.1 release --- date-2.1.0-1.rockspec | 6 +++--- date.lua | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/date-2.1.0-1.rockspec b/date-2.1.0-1.rockspec index 3afdbf6..7ee6836 100644 --- a/date-2.1.0-1.rockspec +++ b/date-2.1.0-1.rockspec @@ -2,9 +2,9 @@ package = "date" version = "2.1.0-1" description = { - summary = "Date & Time module for Lua 5.x", + summary = "Date & Time module for Lua 5.1/5.2", detailed = [[ - Pure Lua Date & Time module for Lua 5.x featuring date and Time string + Pure Lua Date & Time module for Lua 5.1/5.2 featuring date and Time string parsing, time addition & subtraction, time span calculation, support for ISO 8601 Dates, local time support, strftime-like formatting. ]], @@ -17,7 +17,7 @@ dependencies = { } source = { - url = "https://github.com/Tieske/uuid/archive/version_2.1.tar.gz", + url = "https://github.com/Tieske/date/archive/version_2.1.tar.gz", dir = "date-version_2.1", } diff --git a/date.lua b/date.lua index db9ba5e..fcf2843 100644 --- a/date.lua +++ b/date.lua @@ -335,14 +335,14 @@ repeat -- print(sw:aimchr()) if sw("^[tT:]?%s*(%d%d?):",seth) then --print("$Time") _ = sw("^%s*(%d%d?)",setr) and sw("^%s*:%s*(%d%d?)",sets) and sw("^(%.%d+)",adds) - elseif sw("^(%d+)[/\%s,-]?%s*") then --print("$Digits") + elseif sw("^(%d+)[/\\%s,-]?%s*") then --print("$Digits") x, c = tonumber(sw[1]), len(sw[1]) if (x >= 70) or (m and d and (not y)) or (c > 3) then sety( x + ((x >= 100 or c>3)and 0 or 1900) ) else if m then setd(x) else m = x end end - elseif sw("^(%a+)[/\%s,-]?%s*") then --print("$Words") + elseif sw("^(%a+)[/\\%s,-]?%s*") then --print("$Words") x = sw[1] if inlist(x, sl_months, 2, sw) then if m and (not d) and (not y) then d, m = m, false end