jungsoft / materialui-daterange-picker

A react date range picker implementation using @material-ui.
MIT License
70 stars 81 forks source link

Unable to append custom defined range to existing #20

Open madhurisandbhor opened 3 years ago

madhurisandbhor commented 3 years ago

Hi,

I want to add some more custom defined range to existing ones, for e.g: last 6 months, or last year. If I add using definedRanges options, it just overrides the existing. I want to append few more to existing date ranges.

I tried this but I think it doesn't suport function, definedRanges={(prev: DefinedRange[]): DefinedRange[] => [ ...prev, { label: 'Last 6 months', startDate: new Date(), endDate: (new Date().getMonth() - 6), }, ]}

Is there any way to append to existing date ranges? Thanks