Skip to content

Time offset and number of days in a month. #436

Answered by caiusseverus
caiusseverus asked this question in Q&A
Discussion options

You must be logged in to vote

There's current_month here
but that won't show you the previous month.

Sorry I didn't post code - that's what I was using to select the date range. It works as expected to show this months data, but the issue is overlaying data from the previous month. The time_offset function is fixed at 30 days, while the span of current_month obviously varies with the number of days.

I think that the first script there is not necessary - current_month does what it's supposed to. It's time_offset that's problematic. Thanks for the ChatGPT suggestion, I hadn't thought of using that. Here's what it gave me:

time_offset: |-
  $ex {
    const currentDate = new Date();
    const currentYear = currentDate.g…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@dbuezas
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by caiusseverus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants