set width calendar full and responsive

This commit is contained in:
Ehsan
2024-09-26 18:12:15 +03:30
parent 86301000af
commit d4a95ce32e
2 changed files with 28 additions and 7 deletions
+4 -7
View File
@@ -2,8 +2,7 @@
import { useEffect, useRef, useState } from "react";
import { DatePicker as DatePickerJalali } from "jalaali-react-date-picker";
import Image from "next/image";
import { Button, Skeleton } from "@mui/material";
import { Skeleton } from "@mui/material";
import NextIconDatePicker from "./NextIconDatePicker";
import PrevIconDatePicker from "./PrevIconDatePicker";
@@ -18,16 +17,14 @@ function DatePicker({ date, updateDate }) {
const handleStartDateChange = (date) => {
if (date) {
setStartDate(date);
setEndDate(null); // Clear end date if start date is selected
// updateDate(date); // Notify parent about the selected date
setEndDate(null);
}
};
const handleEndDateChange = (date) => {
if (date) {
setEndDate(date);
setStartDate(null); // Clear start date if end date is selected
// updateDate(date); // Notify parent about the selected date
setStartDate(null);
}
};
@@ -44,7 +41,7 @@ function DatePicker({ date, updateDate }) {
}, [nextIconDatePicker]);
return (
<div className="flex items-start justify-evenly w-full">
<div className="flex items-start custom-datepicker justify-evenly w-full">
<div className="w-full md:w-1/2 lg:w-full xl:w-1/2 relative flex justify-center">
<DatePickerJalali
value={startDate}