mirror of
https://github.com/urosran/cally.git
synced 2025-07-16 01:56:16 +00:00
All day event package
This commit is contained in:
@ -9,11 +9,12 @@ export const useFetchAndSaveAppleEvents = () => {
|
||||
const {mutateAsync: createEventsFromProvider} = useCreateEventsFromProvider();
|
||||
|
||||
return useMutation({
|
||||
mutationKey: ["fetchAndSaveAppleEvents"],
|
||||
mutationFn: async ({token, email}: { token?: string, email?: string }) => {
|
||||
console.log("CALLL")
|
||||
const timeMin = new Date(new Date().setFullYear(new Date().getFullYear() - 1));
|
||||
const timeMax = new Date(new Date().setFullYear(new Date().getFullYear() + 5));
|
||||
mutationKey: ["fetchAndSaveAppleEvents", "sync"],
|
||||
mutationFn: async ({token, email, date}: { token?: string; email?: string, date?: Date }) => {
|
||||
const baseDate = date || new Date();
|
||||
const timeMin = new Date(new Date(baseDate).setFullYear(new Date(baseDate).getMonth() - 1));
|
||||
const timeMax = new Date(new Date(baseDate).setFullYear(new Date(baseDate).getMonth() + 1));
|
||||
|
||||
try {
|
||||
const response = await fetchiPhoneCalendarEvents(
|
||||
profileData?.familyId!,
|
||||
|
Reference in New Issue
Block a user