@timardex/cluemart-shared 2.5.2 → 3.0.0

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.
@@ -1,18 +1,18 @@
1
- import "../chunk-YJJUTHBX.mjs";
1
+ import "../chunk-OVSUNBMA.mjs";
2
2
  import "../chunk-VA5YN2K3.mjs";
3
3
  import "../chunk-VPANTTZI.mjs";
4
4
  import "../chunk-DWO35OY4.mjs";
5
- import "../chunk-WRYRBSRZ.mjs";
5
+ import "../chunk-FVUZ5SPE.mjs";
6
6
  import {
7
7
  SCHOOL_MIN_STUDENT_COUNT,
8
8
  isValidIrdNumber,
9
9
  normalizeUrl
10
- } from "../chunk-T736WX7J.mjs";
10
+ } from "../chunk-XXHTG4GJ.mjs";
11
11
  import "../chunk-RE4NZPYY.mjs";
12
12
  import {
13
13
  dateFormat,
14
14
  timeFormat
15
- } from "../chunk-TGEYOSSX.mjs";
15
+ } from "../chunk-ENRGEWZM.mjs";
16
16
  import {
17
17
  EnumAdShowOn,
18
18
  EnumAdStatus,
package/dist/index.cjs CHANGED
@@ -314,7 +314,6 @@ __export(index_exports, {
314
314
  isInternalErrorMessage: () => isInternalErrorMessage,
315
315
  isIsoDateString: () => isIsoDateString,
316
316
  isNonVisitorResourceType: () => isNonVisitorResourceType,
317
- isPastDate: () => isPastDate,
318
317
  isPostShareResourceType: () => isPostShareResourceType,
319
318
  isRelationShareResourceType: () => isRelationShareResourceType,
320
319
  isResourceImageActive: () => isResourceImageActive,
@@ -1331,11 +1330,10 @@ function nzDayKey(input) {
1331
1330
  function isUtcMidnight(value) {
1332
1331
  return value instanceof Date && !Number.isNaN(value.getTime()) && value.getUTCHours() === 0 && value.getUTCMinutes() === 0 && value.getUTCSeconds() === 0 && value.getUTCMilliseconds() === 0;
1333
1332
  }
1334
- var DATE_DISPLAY_FORMAT = "dddd, D MMMM, YYYY";
1335
1333
  var formatDate = (dateStr, display = "datetime", timeStr) => {
1336
1334
  const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
1337
1335
  const dateTime = timeStr ? (0, import_dayjs2.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs2.default)(dateStr, dateFormat);
1338
- const formattedDate = dateTime.format(DATE_DISPLAY_FORMAT);
1336
+ const formattedDate = dateTime.format("dddd, D MMMM, YYYY");
1339
1337
  const formattedTime = dateTime.format("h:mm a");
1340
1338
  switch (display) {
1341
1339
  case "date":
@@ -1348,24 +1346,13 @@ var formatDate = (dateStr, display = "datetime", timeStr) => {
1348
1346
  return formattedDate;
1349
1347
  }
1350
1348
  };
1351
- function parseStrictDate(dateStr) {
1352
- return (0, import_dayjs2.default)(dateStr, dateFormat, true);
1353
- }
1354
- function isDayBeforeNzToday(parsed) {
1355
- const dayKey = /* @__PURE__ */ new Date(`${parsed.format(isoDateFormat)}T00:00:00Z`);
1356
- return dayKey.getTime() < nzDayKey().getTime();
1357
- }
1358
- function isPastDate(dateStr) {
1359
- const parsed = parseStrictDate(dateStr);
1360
- return parsed.isValid() && isDayBeforeNzToday(parsed);
1361
- }
1362
1349
  function formatDateOptionLabel(dateStr) {
1363
- const parsed = parseStrictDate(dateStr);
1350
+ const parsed = (0, import_dayjs2.default)(dateStr, dateFormat, true);
1364
1351
  if (!parsed.isValid()) {
1365
1352
  return dateStr;
1366
1353
  }
1367
- const label = parsed.format(DATE_DISPLAY_FORMAT);
1368
- return isDayBeforeNzToday(parsed) ? `${label} (Past)` : label;
1354
+ const label = formatDate(dateStr, "date");
1355
+ return parsed.isBefore((0, import_dayjs2.default)(), "day") ? `${label} (Past)` : label;
1369
1356
  }
1370
1357
  var SLOT_FORMATS = [
1371
1358
  `${dateFormat} ${timeFormat}`,
@@ -10877,7 +10864,6 @@ function canAccessAdminPath(roles, pathname) {
10877
10864
  isInternalErrorMessage,
10878
10865
  isIsoDateString,
10879
10866
  isNonVisitorResourceType,
10880
- isPastDate,
10881
10867
  isPostShareResourceType,
10882
10868
  isRelationShareResourceType,
10883
10869
  isResourceImageActive,