react-date-range icon indicating copy to clipboard operation
react-date-range copied to clipboard

How to view current and previous months, not current and next months

Open aree5741 opened this issue 7 years ago • 4 comments

Is there a way to show the current and previous months, not the current and next months ?

aree5741 avatar Jan 03 '19 14:01 aree5741

Any updates on this? Also curious

omelhoro avatar Jan 16 '19 13:01 omelhoro

Any updates on this?

Dharnu avatar Jun 27 '19 09:06 Dharnu

if you are fine with only changing the initial range, a workaround could be:

const offsetInitialMonth = useCallback(node => { if (node !== null) { node.dateRange.calendar.changeShownDate(moment().subtract(1, "month").toDate()); } }, []);

<DateRangePicker ... ref={offsetInitialMonth} />

mikinw avatar Aug 07 '20 08:08 mikinw

For initial range, you can also just do:

<DateRangePicker
  ...
  shownDate={moment().subtract(1, 'month').toDate()}
/>

Would also love to be able to always show backwards-facing dates rather than forward facing.

lexispike avatar Nov 10 '20 17:11 lexispike