Skip to content

Commit

Permalink
fix: bug that always display data range since the same date
Browse files Browse the repository at this point in the history
  • Loading branch information
mgierada committed Jun 16, 2024
1 parent 1e9fa3a commit ce6e3c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/src/components/Callendar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import {
} from "@/components/ui/popover";

const Callendar = ({ className, lastTimeReseted, currentCouterValue }) => {
const fromDate = lastTimeReseted
? new Date(lastTimeReseted)
: new Date(2024, 4, 13);
const [date, setDate] = React.useState({
from: lastTimeReseted ? new Date(lastTimeReseted) : new Date(2024, 4, 13),
to: addDays(new Date(2024, 4, 13), currentCouterValue),
from: fromDate,
to: addDays(fromDate, currentCouterValue),
});
return (
<div className={cn("grid gap-2", className)}>
Expand Down

0 comments on commit ce6e3c3

Please sign in to comment.