@opendesign-plus-test/components 0.0.1-rc.87 → 0.0.1-rc.89

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.
@@ -180,14 +180,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
180
180
  if (latestDayLoaded.value) {
181
181
  return latestDayLoaded.value;
182
182
  }
183
- if (allDates.value.length) {
184
- let find = allDates.value.find((v) => dayjs(v).isAfter(dayjs()));
185
- if (!find) {
186
- find = [...allDates.value].reverse().find((v) => dayjs().isAfter(dayjs(v)));
187
- }
188
- return formatDate(find);
183
+ const dates = allDates.value;
184
+ if (!dates.length) return null;
185
+ const today = dayjs().format("YYYY-MM-DD");
186
+ let lo = 0, hi = dates.length - 1;
187
+ while (lo <= hi) {
188
+ const mid = lo + hi >> 1;
189
+ if (dates[mid] < today) lo = mid + 1;
190
+ else hi = mid - 1;
189
191
  }
190
- return null;
192
+ return formatDate(lo < dates.length ? dates[lo] : dates[dates.length - 1]);
191
193
  });
192
194
  const changeMeetingDay = useDebounceFn((day, event) => {
193
195
  if (isAutoClick.value) {
@@ -207,8 +209,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
207
209
  if (latestDay.value) {
208
210
  latestDayLoaded.value = latestDay.value;
209
211
  (_a = calendar.value) == null ? void 0 : _a.pickDay(dayjs(latestDay.value));
212
+ console.log("latestDay", 1, latestDay.value);
210
213
  changeMeetingDay(latestDay.value);
211
214
  } else {
215
+ console.log("latestDay", 2, latestDay.value);
212
216
  changeMeetingDay(formatDate());
213
217
  }
214
218
  },
@@ -223,6 +227,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
223
227
  }
224
228
  isLimit.value = false;
225
229
  calendar.value.selectDate(val);
230
+ console.log("selectDate", calendar.value.selectedDay);
226
231
  changeMeetingDay(formatDate(calendar.value.selectedDay));
227
232
  };
228
233
  const changeGroup = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendesign-plus-test/components",
3
- "version": "0.0.1-rc.87",
3
+ "version": "0.0.1-rc.89",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",