punchcard: shift midnight alignment
This commit is contained in:
parent
b1784a694a
commit
01a3c60ceb
|
@ -16,11 +16,18 @@ class Command(GraphCommand):
|
|||
if options.get('committime'):
|
||||
datetime_var = 'commit_datetime'
|
||||
|
||||
def hour_shift(x):
|
||||
x = x - 4
|
||||
if x < 0:
|
||||
x += 24
|
||||
return x
|
||||
|
||||
for commit in self.get_events(options):
|
||||
coords = (getattr(commit, datetime_var).weekday(), getattr(commit, datetime_var).hour)
|
||||
coords = (getattr(commit, datetime_var).weekday(), hour_shift(getattr(commit, datetime_var).hour))
|
||||
infos[coords] = infos[coords] + 1
|
||||
|
||||
draw_punchcard(infos)
|
||||
draw_punchcard(infos,
|
||||
ax2_ticks=list(range(4, 24)) + list(range(4)))
|
||||
self.plot(options)
|
||||
|
||||
# https://stackoverflow.com/a/14850998
|
||||
|
|
Reference in New Issue