@anker-in/ui 0.2.0 → 0.2.2

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.
@@ -6,6 +6,9 @@ import IndexBar from 'antd-mobile/es/components/index-bar';
6
6
  import List from 'antd-mobile/es/components/list';
7
7
  import 'antd-mobile/es/components/index-bar/index-bar.css';
8
8
  import 'antd-mobile/es/components/list/list.css';
9
+ import dayjs from 'dayjs';
10
+ import utc from 'dayjs/plugin/utc';
11
+ import timezone from 'dayjs/plugin/timezone';
9
12
 
10
13
  function cn(...inputs) {
11
14
  return twMerge(clsx(inputs));
@@ -899,6 +902,8 @@ var LocationFilter = ({
899
902
  );
900
903
  };
901
904
  LocationFilter.displayName = "LocationFilter";
905
+ dayjs.extend(utc);
906
+ dayjs.extend(timezone);
902
907
  var defaultPageData = {
903
908
  title: "Find a Studio Near You",
904
909
  loadingText: "Loading demo rooms...",
@@ -1078,6 +1083,20 @@ var RoomsList = ({
1078
1083
  const city = room.location?.city || "";
1079
1084
  const addressParts = [room.address, city, state, country].filter(Boolean);
1080
1085
  const fullAddress = addressParts.join(", ");
1086
+ let formattedTime = mergedPageData.noAvailableTime;
1087
+ if (nextAvailableTimeslot) {
1088
+ try {
1089
+ const timeInZone = dayjs(nextAvailableTimeslot.start_time).tz(
1090
+ room.timezone || "America/Los_Angeles"
1091
+ );
1092
+ const month = timeInZone.format("MMM");
1093
+ const day = timeInZone.format("D");
1094
+ const time = timeInZone.format("h:mm A");
1095
+ formattedTime = `${month}.${day}, ${time}`;
1096
+ } catch (error2) {
1097
+ formattedTime = nextAvailableTimeslot.start_time;
1098
+ }
1099
+ }
1081
1100
  return {
1082
1101
  id: room.code,
1083
1102
  name: room.name,
@@ -1088,7 +1107,7 @@ var RoomsList = ({
1088
1107
  country,
1089
1108
  lat: Number(room.latitude) || 0,
1090
1109
  lng: Number(room.longitude) || 0,
1091
- availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : mergedPageData.noAvailableTime,
1110
+ availableTime: formattedTime,
1092
1111
  euifyMakeModel: room?.equipment?.join(", ") || ""
1093
1112
  };
1094
1113
  });