@antscorp/antsomi-ui 1.3.5-beta.677 → 1.3.5-beta.678

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.
@@ -64,6 +64,8 @@ export const AdvancedPicker = props => {
64
64
  },
65
65
  date: dayjs().tz(timezone).format(format),
66
66
  dateDisplay: dayjs().tz(timezone).format(format),
67
+ // date: dayjs(propsDate).tz(timezone).format(format),
68
+ // dateDisplay: dayjs(propsDate).tz(timezone).format(format),
67
69
  });
68
70
  const { isOpen, option, date, dateDisplay } = state;
69
71
  const isShowFixed = option.dateType.value === 'fixed' || onlyShowFixed;
@@ -146,9 +148,17 @@ export const AdvancedPicker = props => {
146
148
  }
147
149
  }, [option, format, timezone]);
148
150
  useDeepCompareEffect(() => {
151
+ const DEFAULT_OPTION = onlyShowFixed
152
+ ? {
153
+ dateType: 'fixed',
154
+ calculationDate: 'days',
155
+ calculationType: 'minus',
156
+ value: 0,
157
+ }
158
+ : {};
149
159
  try {
150
- if (propsOption) {
151
- const { dateType, calculationType, calculationDate, value = 0 } = propsOption || {};
160
+ if (propsOption || onlyShowFixed) {
161
+ const { dateType, calculationType, calculationDate, value = 0, } = propsOption || DEFAULT_OPTION;
152
162
  const newDateTypes = DATE_TYPES;
153
163
  const newDateType = newDateTypes.find(dType => dType.value === dateType);
154
164
  const newCalculationType = CALCULATION_TYPES.find(calType => calType.value === calculationType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.677",
3
+ "version": "1.3.5-beta.678",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",