Skip to content

Commit

Permalink
fix: update current date using effect hook
Browse files Browse the repository at this point in the history
  • Loading branch information
nunom27 committed Sep 19, 2024
1 parent e946d38 commit d26e31d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pages/schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ export default function Schedule({ filters, shifts }: ISchedulesProps) {

const [currentDate, setCurrentDate] = useState(() => new Date());

useEffect(() => {
setCurrentDate(new Date());
}, []);

return (
<Layout
isHome={false}
Expand Down

0 comments on commit d26e31d

Please sign in to comment.