react-multi-date-picker icon indicating copy to clipboard operation
react-multi-date-picker copied to clipboard

React-multi-date-picker new DateObject.setDay(31) sets the day to 1. Day 31 is not set

Open KiruthigaManivannan opened this issue 1 year ago • 0 comments

"use client"; import { useState } from "react"; import DatePicker, { DateObject } from "react-multi-date-picker"; import DatePanel from "react-multi-date-picker/plugins/date_panel";

const DashboardOp = () => { const [value, setValue] = useState( [5, 10, 15, 20, 25, 30, 31].map((day) => new DateObject().setDay(day).setMonth(10), ), );

return ( <DatePicker value={value} onChange={setValue} multiple plugins={[<DatePanel position="left" />]} /> ); };

export default DashboardOp;

In the above code , when i give 31 in the array of values, Day 31 is not selected instead Day1 is selected. Please advise on this.

image

KiruthigaManivannan avatar Sep 30 '24 06:09 KiruthigaManivannan