Mode SQL: Dynamic Date Parameters

Mode SQL: Dynamic Date Parameters

Heres a hacky way to do it. Works well for the 1st of the month, not so well for the end, since month ends change dates.

{% form %}

start_date:
  type: date
  default: {{ now | date: %s | date: %Y-%m-01 }}
  description: Only display data after this date.
  
end_date:
  type: date
  default: {{ now | date: %s | date: %Y-%m-30 }}
  description: Only display data before this date.

{% endform %}

Mode SQL: Dynamic Date Parameters

Leave a Reply

Your email address will not be published.