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