put in actual date right closed date

This commit is contained in:
Petr Korolev 2015-02-17 23:09:07 +02:00
parent 1607407ab4
commit ca27b7c21e

View File

@ -59,13 +59,24 @@ module GitHubChangelogGenerator
end end
def find_closed_date_by_commit(issue) def find_closed_date_by_commit(issue)
closed_date = nil
puts issue[:number] puts issue[:number]
unless issue['events'].nil? unless issue['events'].nil?
issue['events'].each{|event| # reverse! - to find latest closed event. (event goes in date order)
puts event[:event] issue['events'].reverse!.each{|event|
if event[:event].eql? 'closed'
if event[:commit_id].nil?
issue[:actual_date] = issue[:closed_at]
else
commit = @github.git_data.commits.get @options[:user], @options[:project], event[:commit_id]
issue[:actual_date] = commit[:author][:date]
end
break
end
} }
end end
0 closed_date
end end
def print_json(json) def print_json(json)