wa0x6e/cal-heatmap

Fetching remote data and dayjs format token regex issue?

ghenry opened this issue · 0 comments

ghenry commented

Hi all,

Following https://cal-heatmap.com/docs/options/data#fetching-data-from-a-remote-source

If I do this in my source:

source: '/api/events/heatmap?start={{start=YYYY-MM-DD}}&end={{end=[year-]YYYY}}', it results in a request like this:

[debug] Processing with SentrypeerWeb.SentrypeerEventHeatmapController.index/2
[debug] heatmap request: %{"en0" => "{{en0=year-2023", "start" => "2023-01-01}}"}
Request: GET /api/events/heatmap?start=2023-01-01}}&en0={{en0=year-2023

but if I switch end and start to:

source: '/api/events/heatmap?end={{end=[year-]YYYY}}&start={{start=YYYY-MM-DD}}', then all is good:

[debug] heatmap request: %{"end" => "year-2024", "start" => "2023-01-01"}
Request: GET /api/events/heatmap?end=year-2024&start=2023-01-01

so I think a regex issue here?