Class: Git::Heatmap::Monthly

Inherits:
Period
  • Object
show all
Defined in:
lib/git/heatmap/period.rb

Instance Method Summary collapse

Methods inherited from Period

#aggregate, #between, #mktime

Instance Method Details

#key(t, p = 0) ⇒ Object



102
103
104
105
106
107
108
# File 'lib/git/heatmap/period.rb', line 102

def key(t, p = 0)
	# Month is from 1 - 12, so we shift it to 0 - 11 + years
	month = (t.month + p) - 1
	year = month / 12
	
	mktime(t.year + year, (month % 12) + 1)
end

#nameObject



98
99
100
# File 'lib/git/heatmap/period.rb', line 98

def name
	"Months"
end