indicator-ui 0.0.50 → 0.0.51

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.js CHANGED
@@ -7539,7 +7539,11 @@ const getInitChosenInterval = ({ start, end, multiple, formatIn }) => {
7539
7539
  };
7540
7540
  const getInitTargetDate = ({ start, end, formatIn }) => {
7541
7541
  const chosenDate = start || end;
7542
- const formatDate = chosenDate ? (0,date_fns__WEBPACK_IMPORTED_MODULE_11__.parse)(chosenDate, formatIn || 'yyyy-MM-dd', new Date()).toISOString() : undefined;
7542
+ let formatDate;
7543
+ try {
7544
+ formatDate = chosenDate ? (0,date_fns__WEBPACK_IMPORTED_MODULE_11__.parse)(chosenDate, formatIn || 'yyyy-MM-dd', new Date()).toISOString() : undefined;
7545
+ }
7546
+ catch (e) { }
7543
7547
  if (formatDate) {
7544
7548
  return formatDate;
7545
7549
  }
@@ -7828,8 +7832,18 @@ function DatePicker({ chosenStart, chosenEnd, markFun, infoFun, onSubmit, format
7828
7832
  setTargetDate(prevState => (0,date_fns__WEBPACK_IMPORTED_MODULE_8__.addMonths)(prevState, 1).toISOString());
7829
7833
  };
7830
7834
  const handleSubmit = () => {
7831
- const start = chosenInterval.start ? (0,date_fns__WEBPACK_IMPORTED_MODULE_9__.format)(chosenInterval.start, formatOut || 'yyyy-MM-dd') : undefined;
7832
- const end = chosenInterval.end ? (0,date_fns__WEBPACK_IMPORTED_MODULE_9__.format)(chosenInterval.end, formatOut || 'yyyy-MM-dd') : undefined;
7835
+ let start = undefined;
7836
+ let end = undefined;
7837
+ try {
7838
+ start = chosenInterval.start ? (0,date_fns__WEBPACK_IMPORTED_MODULE_9__.format)(chosenInterval.start, formatOut || 'yyyy-MM-dd') : undefined;
7839
+ }
7840
+ catch (e) {
7841
+ }
7842
+ try {
7843
+ end = chosenInterval.end ? (0,date_fns__WEBPACK_IMPORTED_MODULE_9__.format)(chosenInterval.end, formatOut || 'yyyy-MM-dd') : undefined;
7844
+ }
7845
+ catch (e) {
7846
+ }
7833
7847
  onSubmit && onSubmit({ start: start, end: end });
7834
7848
  };
7835
7849
  const onClickDate = (date) => {