diff --git a/src/heatmap.rs b/src/heatmap.rs index 2f23fd6..e48fdc9 100644 --- a/src/heatmap.rs +++ b/src/heatmap.rs @@ -55,15 +55,20 @@ impl Heatmap { } } + // Track the very first day of the heatmap, as we don't want the extra spacing in front of + // those. + let mut first_day = true; + while current_day <= until { if split_months { - // If current day is the first of the month we add 2 weeks worth of empty space so - // months are more visible - if current_day.day0() == 0 { + // If current day is the first of the month, but not the first day of the heatmap + // we add 2 weeks worth of empty space so months are more visible + if !first_day && current_day.day0() == 0 { for i in 0..14 { heatmap.data[(i as usize) % 7].push(-1); } } + first_day = false; } let month_name = current_day.format("%b").to_string();