Release (#415)
fix: parse dates without timezone offset (#404) fix: enable replying if tree is in a different tab (#407) fix: wrong get url (#413) fix: Restore cursor when updating from outside of tree (#406) --------- Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me> Co-authored-by: Oscar <oscar.creator13@gmail.com>
This commit is contained in:
committed by
GitHub
parent
341d56a1cb
commit
30daecfb60
@@ -254,6 +254,20 @@ M.format_to_local = function(date_string, offset)
|
||||
local tzOffsetSign, tzOffsetHour, tzOffsetMin
|
||||
year, month, day, hour, min, sec, _, tzOffsetSign, tzOffsetHour, tzOffsetMin =
|
||||
date_string:match("(%d+)-(%d+)-(%d+)T(%d+):(%d+):(%d+).(%d+)([%+%-])(%d%d):(%d%d)")
|
||||
|
||||
-- ISO 8601 format with just "Z" (aka no time offset)
|
||||
-- 2021-01-01T00:00:00Z
|
||||
if year == nil then
|
||||
year, month, day, hour, min, sec = date_string:match("(%d+)-(%d+)-(%d+)T(%d+):(%d+):(%d+)Z")
|
||||
tzOffsetSign = "-"
|
||||
tzOffsetHour = "00"
|
||||
tzOffsetMin = "00"
|
||||
end
|
||||
|
||||
if year == nil then
|
||||
return "Date Unparseable"
|
||||
end
|
||||
|
||||
tzOffset = tzOffsetSign .. tzOffsetHour .. tzOffsetMin
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user