Skip to content

Commit

Permalink
fix(github): filter out numbers from timestamp util
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmarucci committed Jul 16, 2023
1 parent 3c596fe commit 1998b16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/gitsigns/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,13 @@ end

--- Converts a DateTime string into its timestamp
---
--- @param dateTime string
--- @param dateTime string|number
--- @return number? The timestamp
function get_timestamp_from_datetime(dateTime)
if (type(dateTime) ~= 'string') then
return nil
end

local inYear, inMonth, inDay, inHour, inMinute, inSecond, inZone =
string.match(dateTime, '^(%d%d%d%d)-(%d%d)-(%d%d)T(%d%d):(%d%d):(%d%d)(.-)$')

Expand Down

0 comments on commit 1998b16

Please sign in to comment.