evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
3.38k stars 163 forks source link

CalendarHeatmap off by 1 error #1911

Closed archiewood closed 1 week ago

archiewood commented 2 weeks ago

Steps To Reproduce

```sql orders_by_day_2021
select
    date_trunc('day', order_datetime) as day,
    count(*) as num_orders,
    sum(sales) as sales,
    sum(sales) / count(*) as aov
from needful_things.orders
where order_datetime > '2021-01-01'
group by 1
order by 1

<CalendarHeatmap data={orders_by_day} date=day value=sales title="Calendar Heatmap" subtitle="Daily Sales" />



## Expected Behavior

A single year displays with a value for each day

## Actual Behaviour

- Blank year shown
- Jan 1st not shown on 2021

![CleanShot 2024-04-18 at 16 59 44@2x](https://github.com/evidence-dev/evidence/assets/58074498/363f1f26-2b56-4445-8917-4a14a3d42ff4)