mirror of
https://github.com/TangentFoxy/lua-date.git
synced 2025-07-27 18:42:18 +00:00
fixed bad patterns for 5.2
updated rockspec for 2.1 release
This commit is contained in:
@@ -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",
|
||||
}
|
||||
|
||||
|
4
date.lua
4
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
|
||||
|
Reference in New Issue
Block a user