Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Month to Date and Year to Date in Date Range Selector returns wrong range #2450

Open
martonmesz opened this issue Aug 17, 2024 · 0 comments
Labels
bug Something isn't working to-review Evidence team to review

Comments

@martonmesz
Copy link

martonmesz commented Aug 17, 2024

Describe the bug

As per definition Month to Date should return a range from the first day of the month up until now, not including today.
Similarly for Year to Date, the range should go from the first day of the year up until now, not including today.
Instead it selects the end date as the last day of the month or year. This will return wrong data in case there is already some records for today (or the future for some reason, like predictions)

Steps to Reproduce

  1. Create a date range selector as below:
<DateRange
    name=date_range
/>
  1. Write a query that returns the selected values as strings
sql test
  select
    '${inputs.date_range.start}' as start,
    '${inputs.date_range.end}' as end
  1. Examine the returned values

Logs

No response

System Info

System:
    OS: macOS 13.6.4
    CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
    Memory: 102.20 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - /usr/local/bin/node
    npm: 10.8.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 127.0.6533.120
    Safari: 17.3
  npmPackages:
    @evidence-dev/bigquery: ^2.0.7 => 2.0.7 
    @evidence-dev/core-components: ^4.7.2 => 4.7.2 
    @evidence-dev/csv: ^1.0.12 => 1.0.12 
    @evidence-dev/databricks: ^1.0.7 => 1.0.7 
    @evidence-dev/duckdb: ^1.0.11 => 1.0.11 
    @evidence-dev/evidence: ^39.1.1 => 39.1.1 
    @evidence-dev/motherduck: ^1.0.2 => 1.0.2 
    @evidence-dev/mssql: ^1.0.9 => 1.0.9 
    @evidence-dev/mysql: ^1.1.3 => 1.1.3 
    @evidence-dev/postgres: ^1.0.6 => 1.0.6 
    @evidence-dev/snowflake: ^1.1.0 => 1.1.0 
    @evidence-dev/sqlite: ^2.0.6 => 2.0.6 
    @evidence-dev/trino: ^1.0.7 => 1.0.7

Severity

annoyance

Additional Information, or Workarounds

@martonmesz martonmesz added bug Something isn't working to-review Evidence team to review labels Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to-review Evidence team to review
Projects
None yet
Development

No branches or pull requests

1 participant