Fix: date range selector (#6625)

* fix: Handled workspace switcher closing on click

* fix: removed action btns from date range selector

* fix: updated calendar component
This commit is contained in:
Akshita Goyal 2025-02-19 15:01:51 +05:30 committed by GitHub
parent 1c6a2fb7dd
commit f9d154dd82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 111 additions and 88 deletions

View file

@ -1,17 +1,14 @@
"use client";
import { Fragment } from "react";
import { DayPicker, getDefaultClassNames } from "react-day-picker";
import { Controller, useForm } from "react-hook-form";
import { X } from "lucide-react";
import { Dialog, Transition } from "@headlessui/react";
import { Button } from "@plane/ui";
import { Button, Calendar } from "@plane/ui";
import { renderFormattedPayloadDate, renderFormattedDate, getDate } from "@/helpers/date-time.helper";
import { DateFilterSelect } from "./date-filter-select";
type Props = {
title: string;
handleClose: () => void;
@ -31,8 +28,6 @@ const defaultValues: TFormValues = {
date2: new Date(new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()),
};
const defaultClassNames = getDefaultClassNames();
export const DateFilterModal: React.FC<Props> = ({ title, handleClose, isOpen, onSelect }) => {
const { handleSubmit, watch, control } = useForm<TFormValues>({
defaultValues,
@ -98,9 +93,9 @@ export const DateFilterModal: React.FC<Props> = ({ title, handleClose, isOpen, o
const dateValue = getDate(value);
const date2Value = getDate(watch("date2"));
return (
<DayPicker
<Calendar
classNames={{
root: `${defaultClassNames.root} border border-custom-border-200 p-3 rounded-md`,
root: ` border border-custom-border-200 p-3 rounded-md`,
}}
captionLayout="dropdown"
selected={dateValue}
@ -123,9 +118,9 @@ export const DateFilterModal: React.FC<Props> = ({ title, handleClose, isOpen, o
const dateValue = getDate(value);
const date1Value = getDate(watch("date1"));
return (
<DayPicker
<Calendar
classNames={{
root: `${defaultClassNames.root} border border-custom-border-200 p-3 rounded-md`,
root: ` border border-custom-border-200 p-3 rounded-md`,
}}
captionLayout="dropdown"
selected={dateValue}