perspective icon indicating copy to clipboard operation
perspective copied to clipboard

Date filtering off by 1 day

Open rigogsilva opened this issue 3 years ago • 3 comments

Bug Report

Trying to filter by date doesn't really work. It is off by 1 day.

Screenshot 2022-11-29 at 3 38 27 PM copy

Steps to Reproduce:

  1. Setup perspective table with date field in shema:
import { worker } from "https://cdn.jsdelivr.net/npm/@finos/[email protected]/dist/cdn/perspective.min.js";

const PERSPECTIVE_CONFIG = {
  types: {
    date: {
      filter_operator: "==",
      aggregate: "count",
      format: {  dateStyle: "short" },
      null_value: -1
    },
  }
};

const worker_ = worker(PERSPECTIVE_CONFIG);
const table = await worker_.table(schema);
table.update(data);
  1. filter by date as shown in picture above.

Expected Result:

Should return results with dates 10/23/2022.

Actual Result:

Returns rows with data 10/22/2022.

Environment:

rigogsilva avatar Nov 29 '22 21:11 rigogsilva

Hi. This looks interesting and I'd like to work on it. I am still trying to navigate Perspective, but it looks as if the code provided above is incomplete (eg. schema and data are not defined). Can I be directed to a useful resource or shown where to look to resolve this? I'd appreciate it.

dev-navian avatar Apr 19 '23 18:04 dev-navian

You'll need to load your own data to repro, anything with a date column (for example - superstore demo). I reckon the issue lies here, as it does not take into account the browser's local time zone ala here.

We'll need tests for this as well.

texodus avatar Apr 20 '23 00:04 texodus

Alright. Thank you for the response @texodus

dev-navian avatar Apr 21 '23 16:04 dev-navian