-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(congregation): check retention when sending backup
- Loading branch information
Showing
6 changed files
with
173 additions
and
102 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export const getWeekDate = (weekOf) => { | ||
const month = +weekOf.split('/')[0] - 1; | ||
const day = +weekOf.split('/')[1]; | ||
const year = +weekOf.split('/')[2]; | ||
|
||
return new Date(year, month, day); | ||
}; | ||
|
||
export const getOldestWeekDate = () => { | ||
const today = new Date(); | ||
const day = today.getDay(); | ||
const diff = today.getDate() - day + (day === 0 ? -6 : 1); | ||
const weekDate = new Date(today.setDate(diff)); | ||
const validDate = weekDate.setMonth(weekDate.getMonth() - 12); | ||
return new Date(validDate); | ||
}; |
Oops, something went wrong.