Skip to content

Commit

Permalink
fix: date ranger picker value not rendered to UTC in sql (#9860)
Browse files Browse the repository at this point in the history
* fix: date ranger picker value not rendered to UTC in sql

* don't use custom timestamp formatting

* keep table formatting

---------

Co-authored-by: Marshall Agnew <marshall@lightdash.com>
  • Loading branch information
Shifan-Gu and magnew committed Apr 24, 2024
1 parent 8538f34 commit 3013867
Showing 1 changed file with 4 additions and 24 deletions.
Expand Up @@ -2,12 +2,10 @@ import {
DimensionType,
FilterOperator,
formatDate,
formatTimestamp,
isDimension,
isField,
isFilterRule,
parseDate,
parseTimestamp,
TimeFrames,
type ConditionalRule,
type DateFilterRule,
Expand Down Expand Up @@ -303,20 +301,8 @@ const DateFilterInputs = <T extends ConditionalRule = DateFilterRule>(
value={
rule.values && rule.values[0] && rule.values[1]
? [
parseTimestamp(
formatTimestamp(
rule.values[0],
TimeFrames.SECOND,
),
TimeFrames.SECOND,
),
parseTimestamp(
formatTimestamp(
rule.values[1],
TimeFrames.SECOND,
),
TimeFrames.SECOND,
),
dayjs(rule.values[0]).toDate(),
dayjs(rule.values[1]).toDate(),
]
: null
}
Expand All @@ -326,14 +312,8 @@ const DateFilterInputs = <T extends ConditionalRule = DateFilterRule>(
...rule,
values: value
? [
formatTimestamp(
value[0],
TimeFrames.SECOND,
),
formatTimestamp(
value[1],
TimeFrames.SECOND,
),
dayjs(value[0]).format(),
dayjs(value[1]).format(),
]
: [],
});
Expand Down

0 comments on commit 3013867

Please sign in to comment.