-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2766 from ever-co/stage
Release
- Loading branch information
Showing
33 changed files
with
410 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
import { dateRangeAllPlanState, dateRangeFuturePlanState, dateRangePastPlanState } from "@app/stores"; | ||
import { useRecoilState } from "recoil"; | ||
import { dateRangeAllPlanState, dateRangeFuturePlanState, dateRangePastPlanState, getFirstAndLastDateState } from "@app/stores"; | ||
import { useRecoilState, useRecoilValue } from "recoil"; | ||
|
||
export const useDateRange = (tab: string | any) => { | ||
const itemsDate = useRecoilValue(getFirstAndLastDateState); | ||
const [dateFuture, setDateFuture] = useRecoilState(dateRangeFuturePlanState); | ||
const [dateAllPlan, setDateAllPlan] = useRecoilState(dateRangeAllPlanState); | ||
const [datePastPlan, setDatePastPlan] = useRecoilState(dateRangePastPlanState); | ||
switch (tab) { | ||
case 'Future Tasks': | ||
return { date: dateFuture, setDate: setDateFuture }; | ||
return { date: dateFuture, setDate: setDateFuture, data: itemsDate }; | ||
case 'Past Tasks': | ||
return { date: datePastPlan, setDate: setDatePastPlan }; | ||
return { date: datePastPlan, setDate: setDatePastPlan, data: itemsDate }; | ||
case 'All Tasks': | ||
default: | ||
return { date: dateAllPlan, setDate: setDateAllPlan }; | ||
return { date: dateAllPlan, setDate: setDateAllPlan, data: itemsDate }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.