Skip to content

Commit 93521df

Browse files
committed
fix(github): filter out numbers from timestamp util
1 parent 3c596fe commit 93521df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/gitsigns/util.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,13 @@ end
228228

229229
--- Converts a DateTime string into its timestamp
230230
---
231-
--- @param dateTime string
231+
--- @param dateTime string|number
232232
--- @return number? The timestamp
233233
function get_timestamp_from_datetime(dateTime)
234+
if (type(dateTime) == 'number') then
235+
return nil
236+
end
237+
234238
local inYear, inMonth, inDay, inHour, inMinute, inSecond, inZone =
235239
string.match(dateTime, '^(%d%d%d%d)-(%d%d)-(%d%d)T(%d%d):(%d%d):(%d%d)(.-)$')
236240

0 commit comments

Comments
 (0)