ywana-core8 0.0.551 → 0.0.552

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.
@@ -2607,7 +2607,8 @@ var moment = extendMoment(moment$1);
2607
2607
  var Calendar = function Calendar(props) {
2608
2608
  var _props$events = props.events,
2609
2609
  events = _props$events === void 0 ? [] : _props$events,
2610
- children = props.children;
2610
+ children = props.children,
2611
+ onChange = props.onChange;
2611
2612
 
2612
2613
  var _useState = useState(),
2613
2614
  position = _useState[0],
@@ -2617,6 +2618,21 @@ var Calendar = function Calendar(props) {
2617
2618
  var today = moment();
2618
2619
  setPosition(today);
2619
2620
  }, []);
2621
+ useEffect(function () {
2622
+ if (onChange) {
2623
+ var _firstDayOfMonth = position.clone().startOf('month');
2624
+
2625
+ var _firstDayOfRange = _firstDayOfMonth.clone().startOf('isoweek');
2626
+
2627
+ var _lastDayOfMonth = position.clone().endOf('month');
2628
+
2629
+ var _lastDayOfRange = _lastDayOfMonth.clone().endOf('isoweek');
2630
+
2631
+ var _range = moment.range(_firstDayOfRange, _lastDayOfRange);
2632
+
2633
+ onChange(position, _range);
2634
+ }
2635
+ }, [position]);
2620
2636
 
2621
2637
  function next() {
2622
2638
  var next = position.clone().add(1, 'month');