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

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) {
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.88",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",