mirror of
https://github.com/urosran/cally.git
synced 2025-07-16 01:56:16 +00:00
Init date fix
This commit is contained in:
@ -12,12 +12,13 @@ import {
|
||||
} from "react-native-ui-lib";
|
||||
import { ScrollView, TouchableOpacity } from "react-native-gesture-handler";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import { useState } from "react";
|
||||
import {useEffect, useState} from "react";
|
||||
import { MaterialIcons } from "@expo/vector-icons";
|
||||
import { PickerMultiValue } from "react-native-ui-lib/src/components/picker/types";
|
||||
import { useAuthContext } from "@/contexts/AuthContext";
|
||||
import { useCreateEvent } from "@/hooks/firebase/useCreateEvent";
|
||||
import { EventData } from "@/hooks/firebase/types/eventData";
|
||||
import {addHours} from "date-fns";
|
||||
|
||||
const daysOfWeek = [
|
||||
{ label: "Monday", value: "monday" },
|
||||
@ -45,10 +46,10 @@ export const ManuallyAddEventModal = ({
|
||||
|
||||
const [isAllDay, setIsAllDay] = useState(false);
|
||||
const [startTime, setStartTime] = useState(initialDate ?? new Date());
|
||||
const [endTime, setEndTime] = useState(new Date());
|
||||
const [endTime, setEndTime] = useState(initialDate ? addHours(initialDate, 1) : new Date());
|
||||
|
||||
const [startDate, setStartDate] = useState(new Date());
|
||||
const [endDate, setEndDate] = useState(new Date());
|
||||
const [startDate, setStartDate] = useState(initialDate ?? new Date());
|
||||
const [endDate, setEndDate] = useState(initialDate ?? new Date());
|
||||
|
||||
const [repeatInterval, setRepeatInterval] = useState<PickerMultiValue>([]);
|
||||
|
||||
@ -144,6 +145,8 @@ export const ManuallyAddEventModal = ({
|
||||
);
|
||||
}
|
||||
|
||||
console.log(startDate, startTime)
|
||||
|
||||
return (
|
||||
<Modal
|
||||
visible={show}
|
||||
|
Reference in New Issue
Block a user