Skip to content
Snippets Groups Projects
Commit 875998f9 authored by Lukas's avatar Lukas
Browse files

Update date time picker to select same date

parent abfef5c9
No related branches found
No related tags found
2 merge requests!491Lbudginas/#391 new date time picker,!486Lbudginas/#374 calendar dates selection bug
import * as React from "react";
import React from "react";
import { Calendar as CalendarIcon } from "lucide-react";
import { Matcher } from "react-day-picker";
import { Button } from "./ui/button";
......@@ -42,14 +42,15 @@ const DateTimePicker: React.FC<DateTimePickerProps> = ({
const disableFuture: Matcher | Matcher[] | undefined | any = (date: Date) => {
if (disableFutureDates) {
if (firstDate) {
return date <= firstDate || date < new Date("1900-01-01");
return date < firstDate || date < new Date("1900-01-01");
}
if (lastDate) {
return date >= lastDate || date < new Date("1900-01-01");
return date > lastDate || date < new Date("1900-01-01");
}
return date >= new Date() || date < new Date("1900-01-01");
return date > new Date() || date < new Date("1900-01-01");
}
};
return (
<Popover>
<PopoverTrigger
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment