pcm-shared-components 2.0.86 → 2.0.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { DayPicker } from 'react-day-picker';
4
4
  import 'react-day-picker/dist/style.css';
@@ -22,6 +22,10 @@ export const PricingCalendar = props => {
22
22
  RenderDay
23
23
  } = props;
24
24
  console.log('debug props', props);
25
+ const [month, setMonth] = useState(moment().toDate());
26
+ useEffect(() => {
27
+ setMonth(moment(startDate).toDate());
28
+ }, [startDate]);
25
29
  const DefaultRenderDayComponent = ({
26
30
  date,
27
31
  foundPrice
@@ -78,11 +82,11 @@ export const PricingCalendar = props => {
78
82
  components: {
79
83
  Day: handleDayRender
80
84
  },
81
- defaultMonth: moment(startDate).toDate()
82
- // month={startDate}
83
- ,
84
- fromDate: startDate,
85
- toDate: endDate
85
+ defaultMonth: moment(startDate).toDate(),
86
+ month: month,
87
+ onMonthChange: setMonth,
88
+ fromDate: moment(startDate).toDate(),
89
+ toDate: moment(endDate).toDate()
86
90
 
87
91
  // captionLayout="dropdown-buttons" fromYear={moment().add(-5,'years').year()} toYear={moment().add(5, 'years').year()}
88
92
  // selectedDays={[moment(startDate), { from: moment(startDate).toDate(), to: new moment(endDate).toDate() }]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "2.0.86",
3
+ "version": "2.0.88",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {