tools: modules: committer_count: Parse date argument with Time.parse

This commit is contained in:
bcoles 2023-03-29 01:45:27 +11:00
parent e2e8568860
commit 74bb908e56
No known key found for this signature in database
GPG Key ID: 3EB700FCFBA899B5
1 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@
# History with colors and e-mail addresses (respecting .mailmap):
# git log --pretty=format:"%C(white)%ad %C(yellow)%h %Cblue'%aN' <%aE> %Cgreen%f%Creset" --date=short
#
require 'time'
class GitLogLine < Struct.new(:date, :hash, :author, :message)
end
@ -44,7 +45,7 @@ def parse_date(date)
seconds = $1.to_i* (60*60*24)
calc_date = (Time.now - seconds).strftime("%Y-%m-%d")
else
calc_date = Time.new(date).strftime("%Y-%m-%d")
calc_date = Time.parse(date).strftime("%Y-%m-%d")
end
end