fix: weird date override behaviour (#12292)

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
Somay Chauhan 2023-11-17 02:39:48 +05:30 committed by GitHub
parent 28acbe549a
commit 57a65401e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,8 @@ const DateOverrideForm = ({
const form = useForm({
values: {
range: value
range:
value && value[0].start.valueOf() !== value[0].end.valueOf()
? value.map((range) => ({
start: new Date(
dayjs
@ -128,7 +129,7 @@ const DateOverrideForm = ({
? selectedDates.map((date) => {
return {
start: date.utc(true).startOf("day").toDate(),
end: date.utc(true).startOf("day").add(1, "day").toDate(),
end: date.utc(true).startOf("day").toDate(),
};
})
: datesInRanges