mirror of
https://github.com/urosran/cally.git
synced 2025-11-27 17:04:55 +00:00
start on 0 seconds
This commit is contained in:
@ -12,7 +12,7 @@ import {
|
|||||||
} from "react-native-ui-lib";
|
} from "react-native-ui-lib";
|
||||||
import {ScrollView, TouchableOpacity} from "react-native-gesture-handler";
|
import {ScrollView, TouchableOpacity} from "react-native-gesture-handler";
|
||||||
import {useSafeAreaInsets} from "react-native-safe-area-context";
|
import {useSafeAreaInsets} from "react-native-safe-area-context";
|
||||||
import {useEffect, useState} from "react";
|
import {useState} from "react";
|
||||||
import {MaterialIcons} from "@expo/vector-icons";
|
import {MaterialIcons} from "@expo/vector-icons";
|
||||||
import {PickerMultiValue} from "react-native-ui-lib/src/components/picker/types";
|
import {PickerMultiValue} from "react-native-ui-lib/src/components/picker/types";
|
||||||
import {useAuthContext} from "@/contexts/AuthContext";
|
import {useAuthContext} from "@/contexts/AuthContext";
|
||||||
@ -45,8 +45,16 @@ export const ManuallyAddEventModal = ({
|
|||||||
const [title, setTitle] = useState<string>("");
|
const [title, setTitle] = useState<string>("");
|
||||||
|
|
||||||
const [isAllDay, setIsAllDay] = useState(false);
|
const [isAllDay, setIsAllDay] = useState(false);
|
||||||
const [startTime, setStartTime] = useState(initialDate ?? new Date());
|
const [startTime, setStartTime] = useState(() => {
|
||||||
const [endTime, setEndTime] = useState(initialDate ? addHours(initialDate, 1) : new Date());
|
const date = initialDate ?? new Date();
|
||||||
|
date.setSeconds(0, 0);
|
||||||
|
return date;
|
||||||
|
});
|
||||||
|
const [endTime, setEndTime] = useState(() => {
|
||||||
|
const date = initialDate ? addHours(initialDate, 1) : new Date();
|
||||||
|
date.setSeconds(0, 0);
|
||||||
|
return date;
|
||||||
|
});
|
||||||
|
|
||||||
const [startDate, setStartDate] = useState(initialDate ?? new Date());
|
const [startDate, setStartDate] = useState(initialDate ?? new Date());
|
||||||
const [endDate, setEndDate] = useState(initialDate ?? new Date());
|
const [endDate, setEndDate] = useState(initialDate ?? new Date());
|
||||||
|
|||||||
Reference in New Issue
Block a user