@seafile/seafile-calendar 0.0.31-Apph0.26 → 0.0.31-Apph0.28

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.
@@ -614,6 +614,7 @@ function getDatePart(str) {
614
614
 
615
615
  function initializeStr(str, format) {
616
616
  var inputStr = str;
617
+ if (!inputStr) return '';
617
618
  var inputStrLength = inputStr.length;
618
619
  var time = getCurrentTime();
619
620
  var hasSpecial = hasSpecialChar(inputStr);
@@ -7403,15 +7404,10 @@ var _initialiseProps = function _initialiseProps() {
7403
7404
  selectedValue = _props.selectedValue,
7404
7405
  defaultValue = _props.defaultValue;
7405
7406
 
7406
- console.log('str', str);
7407
- // 没有内容,合法并直接退出
7408
- if (!str) {
7409
- onChange(defaultValue);
7410
- _this2.setState({ str: '' });
7411
- return;
7412
- }
7407
+ console.log('calendarStr', calendarStr);
7413
7408
  var parsed = __WEBPACK_IMPORTED_MODULE_8_dayjs___default()(calendarStr, format[0]);
7414
7409
  var value = _this2.props.value.clone();
7410
+ console.log('value', value);
7415
7411
  value = value.year(parsed.year()).month(parsed.month()).date(parsed.date()).hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());
7416
7412
 
7417
7413
  if (!value || disabledDate && disabledDate(value)) {
@@ -7421,7 +7417,8 @@ var _initialiseProps = function _initialiseProps() {
7421
7417
 
7422
7418
  if (selectedValue !== value || selectedValue && value && !selectedValue.isSame(value)) {
7423
7419
  _this2.setState({ str: str });
7424
- onChange(value);
7420
+ var changeVal = calendarStr ? value : defaultValue;
7421
+ onChange(changeVal);
7425
7422
  }
7426
7423
  };
7427
7424