@joewinke/jatui 0.2.17 → 0.2.19

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.
@@ -21,6 +21,7 @@
21
21
  submitting = false,
22
22
  initialName = '',
23
23
  initialEmail = '',
24
+ initialPhone = '',
24
25
  requirePhone = false,
25
26
  showAttendeeOption = true,
26
27
  showNotes = true,
@@ -36,6 +37,7 @@
36
37
  submitting?: boolean;
37
38
  initialName?: string;
38
39
  initialEmail?: string;
40
+ initialPhone?: string;
39
41
  requirePhone?: boolean;
40
42
  showAttendeeOption?: boolean;
41
43
  showNotes?: boolean;
@@ -52,7 +54,8 @@
52
54
  let guestName = $state(initialName);
53
55
  // svelte-ignore state_referenced_locally
54
56
  let guestEmail = $state(initialEmail);
55
- let guestPhone = $state('');
57
+ // svelte-ignore state_referenced_locally
58
+ let guestPhone = $state(initialPhone);
56
59
  let guestNotes = $state('');
57
60
 
58
61
  let attendees = $state<{ name: string; email: string }[]>([]);
@@ -21,6 +21,7 @@ type $$ComponentProps = {
21
21
  submitting?: boolean;
22
22
  initialName?: string;
23
23
  initialEmail?: string;
24
+ initialPhone?: string;
24
25
  requirePhone?: boolean;
25
26
  showAttendeeOption?: boolean;
26
27
  showNotes?: boolean;
@@ -141,8 +141,12 @@
141
141
  const endDate = days[days.length - 1];
142
142
 
143
143
  const counts = await getAvailability(startDate, endDate);
144
+ // AvailabilityCounts is a Map, but tolerate plain-object returns too —
145
+ // Object.entries(aMap) is [] and silently kills the dots.
146
+ const entries =
147
+ counts instanceof Map ? counts.entries() : Object.entries(counts ?? {});
144
148
  const map = new Map<string, { available: number; total: number }>();
145
- for (const [key, value] of Object.entries(counts)) {
149
+ for (const [key, value] of entries) {
146
150
  map.set(key, value);
147
151
  }
148
152
  availabilityCounts = map;
@@ -159,7 +163,9 @@
159
163
  });
160
164
 
161
165
  function getAvailabilityLevel(date: Date): 'none' | 'low' | 'medium' | 'high' | 'full' {
162
- const dateStr = date.toISOString().split('T')[0];
166
+ // Key by LOCAL calendar date — toISOString() shifts to UTC and is off by
167
+ // one day for positive-offset timezones (calendar days are local midnights).
168
+ const dateStr = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
163
169
  const counts = availabilityCounts.get(dateStr);
164
170
 
165
171
  if (!counts || counts.total === 0) return 'none';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joewinke/jatui",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "private": false,
5
5
  "description": "Shared Svelte 5 component library for JAT projects",
6
6
  "type": "module",