Skip to content
Snippets Groups Projects
Unverified Commit 7ac8e3bf authored by Alexander Kiselev's avatar Alexander Kiselev Committed by GitHub
Browse files

Change default "Relative dates..." datetime filter from "Current" to "Past" (#22032)

* Changed default to "past" filter

* Fixed default number of days
parent 060adb06
No related branches found
No related tags found
No related merge requests found
......@@ -125,7 +125,7 @@ const MISC_OPTIONS: Option[] = [
},
{
displayName: t`Relative dates...`,
init: filter => ["time-interval", getDateTimeField(filter[1]), null],
init: filter => ["time-interval", getDateTimeField(filter[1]), -30, "day"],
},
];
......
......@@ -133,6 +133,7 @@ describe("scenarios > question > relative-datetime", () => {
popover().within(() => {
cy.findByText("Filter by this column").click();
cy.findByText("Relative dates...").click();
cy.findByText("Current").click();
cy.findByText("Year").click();
});
cy.wait("@dataset");
......@@ -142,6 +143,21 @@ describe("scenarios > question > relative-datetime", () => {
);
cy.findByText("No results!").should("exist");
});
it("Relative dates should default to past filter (metabase#22027)", () => {
openOrdersTable();
cy.findByTextEnsureVisible("Created At").click();
popover().within(() => {
cy.findByText("Filter by this column").click();
cy.findByText("Relative dates...").click();
cy.findByText("Day").should("not.exist");
cy.findByText("Quarter").should("not.exist");
cy.findByText("Month").should("not.exist");
cy.findByText("Year").should("not.exist");
cy.findByText("days").should("exist");
});
});
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment