exact-scheduler 0.0.1 → 0.1.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.
- package/CHANGELOG.md +65 -0
- package/LICENSE +21 -21
- package/README.md +288 -5
- package/data/index.d.ts +70 -0
- package/data/index.js +298 -0
- package/index.contract +14 -0
- package/package.json +26 -9
- package/src/agenda.contract +56 -0
- package/src/days.contract +68 -0
- package/src/month-schedule.contract +74 -0
- package/src/month.contract +174 -0
- package/src/parts.contract +82 -0
- package/src/pickers.contract +53 -0
- package/src/shapes.contract +98 -0
- package/src/text.contract +31 -0
- package/src/timeline.contract +236 -0
package/data/index.js
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// exact-scheduler/data: the data side of exact-scheduler, for an app's data
|
|
2
|
+
// module (app.ts). Pure functions with no imports, clock, network or storage,
|
|
3
|
+
// so Exact's data runtime takes them on every platform. They name months and
|
|
4
|
+
// weekdays in a locale, and turn the app's records into the per-day segments
|
|
5
|
+
// (with overlap lanes already laid out) that the Contract views draw.
|
|
6
|
+
//
|
|
7
|
+
// Intl's `formatToParts` is not on Apple's engine, so nothing here uses it.
|
|
8
|
+
|
|
9
|
+
const DAY = 86400000;
|
|
10
|
+
const MINUTE = 60000;
|
|
11
|
+
const DAY_MINUTES = 1440;
|
|
12
|
+
const DEFAULT_EVENT_MINUTES = 30;
|
|
13
|
+
const DEFAULT_MIN_MINUTES = 30;
|
|
14
|
+
const DEFAULT_MARK_DOTS = 3;
|
|
15
|
+
const MAX_SPAN_DAYS = 3660;
|
|
16
|
+
const MAX_OFFSET = 1080;
|
|
17
|
+
const DAY_KEY = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
18
|
+
const LOCAL_TIME = /^(\d{4}-\d{2}-\d{2})(?:T(\d{2}):(\d{2})(?::\d{2}(?:\.\d+)?)?)?$/;
|
|
19
|
+
const DURATION = /^P(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/;
|
|
20
|
+
|
|
21
|
+
// CLDR's week data for engines with no `getWeekInfo`: regions whose week
|
|
22
|
+
// starts on a day other than Monday, and whose weekend is not Saturday and
|
|
23
|
+
// Sunday. 0 is Sunday.
|
|
24
|
+
const SUNDAY_REGIONS = new Set('AG AS BD BR BS BT BW BZ CA CO DM DO ET GT GU HK HN ID IL IN IS JM JP KE KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PT PY SA SG SV TH TT TW UM US VE VI WS YE ZA ZW'.split(' '));
|
|
25
|
+
const SATURDAY_REGIONS = new Set('AF BH DJ DZ EG IQ IR JO KW LY OM QA SD SY'.split(' '));
|
|
26
|
+
const LIKELY_REGION = { en: 'US', ar: 'EG', fa: 'IR', he: 'IL', hi: 'IN', ja: 'JP', ko: 'KR', pt: 'BR', th: 'TH', ur: 'PK', bn: 'BD', id: 'ID', ta: 'IN', te: 'IN' };
|
|
27
|
+
const FRIDAY_SATURDAY = new Set('BH DZ EG IL IQ JO KW LY OM QA SA SD SY YE'.split(' '));
|
|
28
|
+
|
|
29
|
+
const isFiniteNumber = (n) => typeof n === 'number' && Number.isFinite(n);
|
|
30
|
+
const text = (v) => (typeof v === 'string' ? v : '');
|
|
31
|
+
// A text's own direction, as HTML's dir="auto" finds it: its first strong letter's. Scripts written right to left
|
|
32
|
+
// give "rtl", any other letter "ltr", and a text with no letter "" (the view's).
|
|
33
|
+
const RIGHT_TO_LEFT = /[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Nko}\p{Script=Samaritan}\p{Script=Mandaic}\p{Script=Adlam}\p{Script=Hanifi_Rohingya}\p{Script=Yezidi}]/u;
|
|
34
|
+
const textDirection = (s) => {
|
|
35
|
+
const letter = s.match(/\p{L}/u)?.[0];
|
|
36
|
+
return letter === undefined ? '' : RIGHT_TO_LEFT.test(letter) ? 'rtl' : 'ltr';
|
|
37
|
+
};
|
|
38
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
39
|
+
|
|
40
|
+
// The whole-day index (days since 1970-01-01) of a real day key.
|
|
41
|
+
function dayIndex(day, who) {
|
|
42
|
+
const m = typeof day === 'string' ? DAY_KEY.exec(day) : null;
|
|
43
|
+
if (m) {
|
|
44
|
+
const at = Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3]));
|
|
45
|
+
if (new Date(at).toISOString().slice(0, 10) === day) return at / DAY;
|
|
46
|
+
}
|
|
47
|
+
throw new TypeError(`${who}: "${day}" is not a YYYY-MM-DD day`);
|
|
48
|
+
}
|
|
49
|
+
const dayKey = (index) => new Date(index * DAY).toISOString().slice(0, 10);
|
|
50
|
+
|
|
51
|
+
/** A day `n` days after `day` (before, when negative). */
|
|
52
|
+
export function addDays(day, n) {
|
|
53
|
+
if (!Number.isInteger(n)) throw new TypeError('addDays: n must be a whole number');
|
|
54
|
+
return dayKey(dayIndex(day, 'addDays') + n);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// A zone as a function from an instant to its local wall time, in ms as if
|
|
58
|
+
// it were UTC. One formatter serves every call: making one is slow on Hermes.
|
|
59
|
+
function wallClock({ timeZone, utcOffset = 0 } = {}) {
|
|
60
|
+
if (timeZone === undefined || timeZone === '') {
|
|
61
|
+
if (!isFiniteNumber(utcOffset) || utcOffset < -MAX_OFFSET || utcOffset > MAX_OFFSET) throw new TypeError('exact-scheduler: utcOffset must be minutes east of UTC');
|
|
62
|
+
return (at) => at + utcOffset * MINUTE;
|
|
63
|
+
}
|
|
64
|
+
if (typeof timeZone !== 'string') throw new TypeError('exact-scheduler: timeZone must be an IANA zone name');
|
|
65
|
+
const f = new Intl.DateTimeFormat('en-US', { timeZone, hourCycle: 'h23', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });
|
|
66
|
+
return (at) => {
|
|
67
|
+
const [month, day, year, hour, minute] = f.format(new Date(at)).match(/\d+/g).map(Number);
|
|
68
|
+
return Date.UTC(year, month - 1, day, hour % 24, minute);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function checkInstant(at, who) {
|
|
73
|
+
if (!isFiniteNumber(at)) throw new TypeError(`${who}: needs a finite number of milliseconds`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The local day ("YYYY-MM-DD") of an instant. */
|
|
77
|
+
export function localDay(at, zone) {
|
|
78
|
+
checkInstant(at, 'localDay');
|
|
79
|
+
return dayKey(Math.floor(wallClock(zone)(at) / DAY));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The minutes since local midnight of an instant. */
|
|
83
|
+
export function localMinute(at, zone) {
|
|
84
|
+
checkInstant(at, 'localMinute');
|
|
85
|
+
const wall = wallClock(zone)(at);
|
|
86
|
+
return Math.floor((wall - Math.floor(wall / DAY) * DAY) / MINUTE);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** A locale's first day of the week and weekend days (0 is Sunday). */
|
|
90
|
+
export function weekInfo(locale) {
|
|
91
|
+
const parsed = new Intl.Locale(locale);
|
|
92
|
+
const info = typeof parsed.getWeekInfo === 'function' ? parsed.getWeekInfo() : parsed.weekInfo;
|
|
93
|
+
if (info && isFiniteNumber(info.firstDay)) return { firstDay: info.firstDay % 7, weekend: info.weekend.map((d) => d % 7) };
|
|
94
|
+
const region = parsed.region || LIKELY_REGION[parsed.language] || '';
|
|
95
|
+
const firstDay = region === 'MV' ? 5 : SUNDAY_REGIONS.has(region) ? 0 : SATURDAY_REGIONS.has(region) ? 6 : 1;
|
|
96
|
+
const weekend = FRIDAY_SATURDAY.has(region) ? [5, 6] : region === 'AF' ? [4, 5] : region === 'IR' ? [5] : region === 'IN' || region === 'UG' ? [0] : [6, 0];
|
|
97
|
+
return { firstDay, weekend };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// A locale whose formatters write Latin digits, so a pattern's numbers can be
|
|
101
|
+
// found in what they print.
|
|
102
|
+
const latin = (locale) => new Intl.Locale(locale, { numberingSystem: 'latn', calendar: 'gregory' }).toString();
|
|
103
|
+
|
|
104
|
+
// Replaces the first of `find` in `s`, in either case (Uzbek writes "28-okt"
|
|
105
|
+
// but "Okt" alone); nothing when `find` is empty or absent.
|
|
106
|
+
function put(s, find, token) {
|
|
107
|
+
const i = find === '' ? -1 : s.toLowerCase().indexOf(find.toLowerCase());
|
|
108
|
+
return i === -1 ? s : `${s.slice(0, i)}${token}${s.slice(i + find.length)}`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// The month's name as it is written beside a day ("14 марта"), from a date
|
|
112
|
+
// printed with only the day and the month. A locale that writes the month as
|
|
113
|
+
// a number there (Chinese, "3月14日") has no such name.
|
|
114
|
+
function monthBesideDay(format, at, alone) {
|
|
115
|
+
const s = format.format(at);
|
|
116
|
+
const digits = s.match(/\d+/g) ?? [];
|
|
117
|
+
if (digits.length !== 1) return alone;
|
|
118
|
+
const words = s.match(/\p{L}[\p{L}\p{M}]*/gu) ?? [];
|
|
119
|
+
return words.reduce((longest, w) => (w.length > longest.length ? w : longest), '') || alone;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Every name the views print for `locale`, from the engine's Intl: month and
|
|
124
|
+
* weekday names, title patterns, digits, hour labels, and the week's first
|
|
125
|
+
* day and weekend. `overrides` replaces any field with the app's own (and
|
|
126
|
+
* takes `hour12`, for the hour labels).
|
|
127
|
+
*
|
|
128
|
+
* The `locale` of the answer is the one the engine had data for. Where that is not
|
|
129
|
+
* the language asked for (Exact's Android engine carries English only), pass
|
|
130
|
+
* the app's own names.
|
|
131
|
+
*/
|
|
132
|
+
export function schedulerNames(locale, overrides = {}) {
|
|
133
|
+
const { hour12, ...own } = overrides;
|
|
134
|
+
const tag = latin(locale);
|
|
135
|
+
const fmt = (o) => new Intl.DateTimeFormat(tag, { timeZone: 'UTC', ...o });
|
|
136
|
+
const monthDays = Array.from({ length: 12 }, (_, m) => Date.UTC(2026, m, 28));
|
|
137
|
+
const weekDays = Array.from({ length: 7 }, (_, d) => Date.UTC(2026, 0, 4 + d)); // 2026-01-04 is a Sunday
|
|
138
|
+
const list = (dates, f) => dates.map((at) => f.format(new Date(at)));
|
|
139
|
+
const long = fmt({ month: 'long' });
|
|
140
|
+
const months = list(monthDays, long);
|
|
141
|
+
const monthsShort = list(monthDays, fmt({ month: 'short' }));
|
|
142
|
+
const beside = fmt({ month: 'long', day: 'numeric' });
|
|
143
|
+
const monthsInDate = monthDays.map((at, m) => monthBesideDay(beside, new Date(at), months[m]));
|
|
144
|
+
const weekdays = list(weekDays, fmt({ weekday: 'long' }));
|
|
145
|
+
const weekdaysShort = list(weekDays, fmt({ weekday: 'short' }));
|
|
146
|
+
const october = new Date(monthDays[9]); // a Wednesday, the 28th: no number in it is another's
|
|
147
|
+
const numbered = (s) => put(put(s, '28', '{day}'), '10', '{monthNumber}');
|
|
148
|
+
const monthTitle = put(put(put(put(fmt({ month: 'long', year: 'numeric' }).format(october), '2026', '{year}'), months[9], '{month}'), monthsInDate[9], '{month}'), '10', '{monthNumber}');
|
|
149
|
+
const dayTitle = numbered(put(put(put(fmt({ weekday: 'long', month: 'long', day: 'numeric' }).format(october), weekdays[3], '{weekday}'), monthsInDate[9], '{monthInDate}'), months[9], '{monthInDate}'));
|
|
150
|
+
const dayShort = numbered(put(fmt({ month: 'short', day: 'numeric' }).format(october), monthsShort[9], '{monthShort}'));
|
|
151
|
+
const hourFormat = new Intl.DateTimeFormat(locale, { hour: 'numeric', timeZone: 'UTC', ...(typeof hour12 === 'boolean' ? { hour12 } : {}) });
|
|
152
|
+
const digitFormat = new Intl.NumberFormat(locale, { useGrouping: false });
|
|
153
|
+
const derived = {
|
|
154
|
+
locale: new Intl.DateTimeFormat(locale).resolvedOptions().locale,
|
|
155
|
+
months, monthsShort, monthsInDate, weekdays, weekdaysShort,
|
|
156
|
+
weekdaysNarrow: list(weekDays, fmt({ weekday: 'narrow' })),
|
|
157
|
+
...weekInfo(locale),
|
|
158
|
+
digits: Array.from({ length: 10 }, (_, n) => digitFormat.format(n)).join(''),
|
|
159
|
+
hours: Array.from({ length: 24 }, (_, h) => hourLabel(hourFormat, h, digitFormat.format(0))),
|
|
160
|
+
monthTitle, dayTitle, dayShort,
|
|
161
|
+
};
|
|
162
|
+
return { ...derived, ...own };
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// "9 AM", or "09:00" where the locale writes a bare hour ("9", "09").
|
|
166
|
+
function hourLabel(format, h, zero) {
|
|
167
|
+
const s = format.format(new Date(Date.UTC(2026, 0, 1, h)));
|
|
168
|
+
return /^\p{Nd}+$/u.test(s) ? `${s}:${zero}${zero}` : s;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// A record's start or end as wall time in ms, as if it were UTC.
|
|
172
|
+
function wallTime(value, wall, who) {
|
|
173
|
+
if (isFiniteNumber(value)) return { at: wall(value), dateOnly: false };
|
|
174
|
+
const m = typeof value === 'string' ? LOCAL_TIME.exec(value) : null;
|
|
175
|
+
if (!m) throw new TypeError(`${who} must be milliseconds, "YYYY-MM-DD" or "YYYY-MM-DDTHH:MM"`);
|
|
176
|
+
const hours = Number(m[2] ?? 0), minutes = Number(m[3] ?? 0);
|
|
177
|
+
if (hours > 24 || minutes > 59 || (hours === 24 && minutes > 0)) throw new TypeError(`${who}: "${value}" has no such time`);
|
|
178
|
+
return { at: dayIndex(m[1], who) * DAY + (hours * 60 + minutes) * MINUTE, dateOnly: m[2] === undefined };
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// A record as whole days (`first`..`last`) and minutes of its first and last.
|
|
182
|
+
function spanOf(r, i, wall) {
|
|
183
|
+
if (r === null || typeof r !== 'object') throw new TypeError(`toSegments: record ${i} is not an object`);
|
|
184
|
+
if (typeof r.id !== 'string' || r.id === '') throw new TypeError(`toSegments: record ${i} needs a non-empty string id`);
|
|
185
|
+
const start = wallTime(r.start, wall, `toSegments: record ${r.id}'s start`);
|
|
186
|
+
const allDay = r.allDay === true || (r.allDay === undefined && start.dateOnly);
|
|
187
|
+
const from = allDay ? Math.floor(start.at / DAY) * DAY : start.at;
|
|
188
|
+
const given = r.end === undefined || r.end === null ? from + (allDay ? DAY : DEFAULT_EVENT_MINUTES * MINUTE) : wallTime(r.end, wall, `toSegments: record ${r.id}'s end`).at;
|
|
189
|
+
if (given < from) throw new RangeError(`toSegments: record ${r.id} ends before it starts`);
|
|
190
|
+
const to = allDay ? Math.max(Math.ceil(given / DAY) * DAY, from + DAY) : given;
|
|
191
|
+
const first = Math.floor(from / DAY);
|
|
192
|
+
const last = Math.max(first, Math.ceil(to / DAY) - 1);
|
|
193
|
+
if (last - first > MAX_SPAN_DAYS) throw new RangeError(`toSegments: record ${r.id} is longer than ${MAX_SPAN_DAYS} days`);
|
|
194
|
+
return { r, allDay, from, to, first, last };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
198
|
+
|
|
199
|
+
// One day's segments in drawing order, with lanes: overlapping events share
|
|
200
|
+
// the column's width in as many lanes as their group needs.
|
|
201
|
+
function layOut(daySegments, minMinutes) {
|
|
202
|
+
const sorted = [...daySegments].sort((a, b) => Number(b.allDay) - Number(a.allDay) || a.startMinute - b.startMinute || b.endMinute - a.endMinute || compare(a.title, b.title) || compare(a.id, b.id));
|
|
203
|
+
const endOf = (s) => Math.max(s.endMinute, s.startMinute + minMinutes);
|
|
204
|
+
const lanes = new Map();
|
|
205
|
+
let group = [], laneEnds = [], groupEnd = -1;
|
|
206
|
+
const close = () => {
|
|
207
|
+
for (const s of group) lanes.set(s.key, { lane: lanes.get(s.key).lane, lanes: laneEnds.length });
|
|
208
|
+
group = []; laneEnds = []; groupEnd = -1;
|
|
209
|
+
};
|
|
210
|
+
for (const s of sorted.filter((x) => !x.allDay)) {
|
|
211
|
+
if (group.length > 0 && s.startMinute >= groupEnd) close();
|
|
212
|
+
const free = laneEnds.findIndex((end) => end <= s.startMinute);
|
|
213
|
+
const lane = free === -1 ? laneEnds.length : free;
|
|
214
|
+
laneEnds = free === -1 ? [...laneEnds, endOf(s)] : laneEnds.map((end, i) => (i === lane ? endOf(s) : end));
|
|
215
|
+
groupEnd = Math.max(groupEnd, endOf(s));
|
|
216
|
+
group = [...group, s];
|
|
217
|
+
lanes.set(s.key, { lane, lanes: 1 });
|
|
218
|
+
}
|
|
219
|
+
close();
|
|
220
|
+
return sorted.map((s, order) => ({ ...s, order, ...(lanes.get(s.key) ?? { lane: 0, lanes: 1 }) }));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The app's records as the segments the views draw: one for each day an event
|
|
225
|
+
* touches, sorted by day, with lanes for overlaps and a time label. Ends are exclusive,
|
|
226
|
+
* as in iCalendar: an event ending at midnight does not touch the next day,
|
|
227
|
+
* and an all-day event on the 5th alone ends on the 6th. `allDay` defaults
|
|
228
|
+
* to true for a date-only start. Give `from` and `to` to keep only the days
|
|
229
|
+
* shown. Recurring events are the app's to expand, one record each.
|
|
230
|
+
*/
|
|
231
|
+
export function toSegments(records, options = {}) {
|
|
232
|
+
if (!Array.isArray(records)) throw new TypeError('toSegments: records must be an array');
|
|
233
|
+
const { from, to, locale, hour12, allDay = '', minMinutes = DEFAULT_MIN_MINUTES } = options;
|
|
234
|
+
if (!isFiniteNumber(minMinutes) || minMinutes < 0) throw new TypeError('toSegments: options.minMinutes must be a number of minutes');
|
|
235
|
+
const wall = wallClock(options);
|
|
236
|
+
const low = from === undefined ? -Infinity : dayIndex(from, 'toSegments');
|
|
237
|
+
const high = to === undefined ? Infinity : dayIndex(to, 'toSegments');
|
|
238
|
+
const format = new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit', timeZone: 'UTC', ...(typeof hour12 === 'boolean' ? { hour12 } : {}) });
|
|
239
|
+
const clock = (at) => format.format(new Date(at));
|
|
240
|
+
const byDay = new Map();
|
|
241
|
+
records.map((r, i) => spanOf(r, i, wall)).forEach((span) => {
|
|
242
|
+
const { r, first, last } = span;
|
|
243
|
+
for (let d = Math.max(first, low); d <= Math.min(last, high); d++) {
|
|
244
|
+
const startMinute = d === first ? (span.from - d * DAY) / MINUTE : 0;
|
|
245
|
+
const endMinute = d === last ? (span.to - d * DAY) / MINUTE : DAY_MINUTES;
|
|
246
|
+
const whole = span.allDay || (startMinute === 0 && endMinute === DAY_MINUTES && first !== last);
|
|
247
|
+
const time = whole ? allDay : first === last ? (span.to > span.from ? `${clock(span.from)} – ${clock(span.to)}` : clock(span.from)) : d === first ? clock(span.from) : `– ${clock(span.to)}`;
|
|
248
|
+
const day = dayKey(d);
|
|
249
|
+
const segment = {
|
|
250
|
+
key: `${r.id}@${day}`, id: r.id, day, title: text(r.title), dir: textDirection(text(r.title)), detail: text(r.detail), tint: text(r.tint),
|
|
251
|
+
allDay: whole, startMinute: Math.floor(startMinute), endMinute: Math.ceil(endMinute), before: d > first, after: d < last, time,
|
|
252
|
+
};
|
|
253
|
+
byDay.set(day, [...(byDay.get(day) ?? []), segment]);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
return [...byDay.keys()].sort().flatMap((day) => layOut(byDay.get(day), minMinutes));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Marks for `MonthCalendar` from segments: up to `max` dots a day (default
|
|
261
|
+
* 3), one for each different tint, and what a screen reader hears after the date
|
|
262
|
+
* (`label(count, day)`, the app's words).
|
|
263
|
+
*/
|
|
264
|
+
export function toMarks(segments, { max = DEFAULT_MARK_DOTS, label = () => '' } = {}) {
|
|
265
|
+
const days = new Map();
|
|
266
|
+
for (const s of segments) days.set(s.day, [...(days.get(s.day) ?? []), s]);
|
|
267
|
+
return [...days].map(([day, list]) => ({ day, tints: [...new Set(list.map((s) => s.tint))].slice(0, max), label: label(list.length, day) }));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// An ISO 8601 duration as JSCalendar writes it, in minutes.
|
|
271
|
+
function durationMinutes(duration, who) {
|
|
272
|
+
const m = DURATION.exec(duration);
|
|
273
|
+
if (!m) throw new TypeError(`${who}: "${duration}" is not a duration`);
|
|
274
|
+
const [weeks, days, hours, minutes, seconds] = m.slice(1).map((n) => Number(n ?? 0));
|
|
275
|
+
return (weeks * 7 + days) * DAY_MINUTES + hours * 60 + minutes + Math.ceil(seconds / 60);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* `@exact/calendar`'s events as records for `toSegments`. Cancelled events
|
|
280
|
+
* are left out. An event with instants (`utcStart`, `utcEnd`) is placed in
|
|
281
|
+
* the zone `toSegments` is given; a floating one by its own local start.
|
|
282
|
+
*/
|
|
283
|
+
export function fromCalendarEvents(events, { tint = '' } = {}) {
|
|
284
|
+
if (!Array.isArray(events)) throw new TypeError('fromCalendarEvents: events must be an array');
|
|
285
|
+
return events.filter((e) => e.status !== 'cancelled').map((e, i) => {
|
|
286
|
+
const base = e.id ?? e.uid ?? `event-${i}`;
|
|
287
|
+
const shared = { id: e.recurrenceId ? `${base}/${e.recurrenceId}` : base, title: text(e.title), detail: text(e.location), tint };
|
|
288
|
+
const local = `${e.start}`.slice(0, 16);
|
|
289
|
+
const minutes = durationMinutes(e.duration, `fromCalendarEvents: event ${shared.id}`);
|
|
290
|
+
if (e.showWithoutTime) return { ...shared, allDay: true, start: local.slice(0, 10), end: addDays(local.slice(0, 10), Math.max(1, Math.ceil(minutes / DAY_MINUTES))) };
|
|
291
|
+
if (isFiniteNumber(e.utcStart) && isFiniteNumber(e.utcEnd)) return { ...shared, allDay: false, start: e.utcStart, end: e.utcEnd };
|
|
292
|
+
const m = LOCAL_TIME.exec(local);
|
|
293
|
+
if (!m) throw new TypeError(`fromCalendarEvents: event ${shared.id} has no such start "${e.start}"`);
|
|
294
|
+
const end = dayIndex(m[1], 'fromCalendarEvents') * DAY + (Number(m[2] ?? 0) * 60 + Number(m[3] ?? 0) + minutes) * MINUTE;
|
|
295
|
+
const iso = new Date(end).toISOString();
|
|
296
|
+
return { ...shared, allDay: false, start: `${m[1]}T${pad(Number(m[2] ?? 0))}:${pad(Number(m[3] ?? 0))}`, end: iso.slice(0, 16) };
|
|
297
|
+
});
|
|
298
|
+
}
|
package/index.contract
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// exact-scheduler: calendar and scheduler views for Expo Exact in Contract
|
|
2
|
+
// alone, so every host draws them with no native code: a month grid with
|
|
3
|
+
// marked dates, a month schedule, day and week timelines, an agenda, and
|
|
4
|
+
// date and date-range pickers. `exact-scheduler/data` turns an app's records
|
|
5
|
+
// into what they draw, and names months and weekdays in a locale, for app.ts.
|
|
6
|
+
|
|
7
|
+
use SchedulerSegment, SchedulerMark, SchedulerNames, SchedulerStrings, SchedulerRules, SchedulerRange from "./src/shapes.contract"
|
|
8
|
+
use dayNumber, dayKeyOf, addDays, addMonths, monthOf, yearOf, monthIndexOf, dateOf, weekdayOf, startOfWeek, daysInMonth, weekNumberOf, monthDays, anyDay, dayAllowed, monthAllowed, nextRange, inRange from "./src/days.contract"
|
|
9
|
+
use monthTitle, dayTitle, dayShort, weekTitle, localDigits, dayWords from "./src/text.contract"
|
|
10
|
+
use MonthCalendar from "./src/month.contract"
|
|
11
|
+
use DatePicker, DateRangePicker from "./src/pickers.contract"
|
|
12
|
+
use MonthSchedule from "./src/month-schedule.contract"
|
|
13
|
+
use DayTimeline, WeekTimeline, Timeline from "./src/timeline.contract"
|
|
14
|
+
use Agenda from "./src/agenda.contract"
|
package/package.json
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "exact-scheduler",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "Calendar and scheduler views
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "exact-scheduler",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Calendar and scheduler views for Expo Exact in pure Contract, so they draw on Android, iOS, macOS, web, Windows and Linux with no native code: a month grid with marked dates, a month schedule, day and week timelines, an agenda, and date and date-range pickers. Locale names, week start and event layout come from data helpers for app.ts.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "softwhere.uz <kamuranbek1998@gmail.com> (https://github.com/softwhere-uz)",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/softwhere-uz/exact-scheduler.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/softwhere-uz/exact-scheduler#readme",
|
|
12
|
+
"bugs": "https://github.com/softwhere-uz/exact-scheduler/issues",
|
|
13
|
+
"keywords": ["exact", "expo-exact", "contract", "calendar", "scheduler", "agenda", "timeline", "week-view", "month-view", "date-picker", "date-range-picker"],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./index.contract",
|
|
17
|
+
"./data": {
|
|
18
|
+
"types": "./data/index.d.ts",
|
|
19
|
+
"default": "./data/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": ["index.contract", "src/*.contract", "data/index.js", "data/index.d.ts", "README.md", "CHANGELOG.md", "LICENSE"],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "bun test test/"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// exact-scheduler: the events as a list under their days. A virtualized
|
|
2
|
+
// list, so a year of events scrolls as a week does.
|
|
3
|
+
|
|
4
|
+
use SchedulerNames, SchedulerStrings, SchedulerSegment from "./shapes.contract"
|
|
5
|
+
use dayTitle from "./text.contract"
|
|
6
|
+
use tintOf from "./text.contract"
|
|
7
|
+
|
|
8
|
+
// The first day on or after `day` that has events, or "".
|
|
9
|
+
fn firstFrom(days: string[], day: string): string = match first(days.filter(d => d >= day)) { case some(d) => d, case none => "" }
|
|
10
|
+
|
|
11
|
+
component Agenda
|
|
12
|
+
props
|
|
13
|
+
id: string
|
|
14
|
+
segments: SchedulerSegment[]
|
|
15
|
+
from: string
|
|
16
|
+
today: string
|
|
17
|
+
names: SchedulerNames
|
|
18
|
+
strings: SchedulerStrings
|
|
19
|
+
label: string
|
|
20
|
+
loading: bool
|
|
21
|
+
pressEvent: action
|
|
22
|
+
derive days = segments.filter(s => s.order == 0).map(s => s.day)
|
|
23
|
+
derive target = firstFrom(days, from)
|
|
24
|
+
task place when not loading and target != "" key=target
|
|
25
|
+
after(1, show)
|
|
26
|
+
action show
|
|
27
|
+
scrollIntoView("scheduler-agenda", target, block="start")
|
|
28
|
+
action one(eventId: string)
|
|
29
|
+
pressEvent(eventId)
|
|
30
|
+
view
|
|
31
|
+
column flex=1 min-height=0 testId=id
|
|
32
|
+
if loading
|
|
33
|
+
row role="status" padding=24 gap=8 justify-content="center" align-items="center" testId=`${id}-loading`
|
|
34
|
+
progress aria-hidden="true"
|
|
35
|
+
text strings.loading font="-exact-subheadline" color="-exact-secondary-label"
|
|
36
|
+
else if days.length == 0
|
|
37
|
+
text strings.noEvents role="status" padding=24 text-align="center" font="-exact-subheadline" color="-exact-secondary-label" testId=`${id}-empty`
|
|
38
|
+
list id="scheduler-agenda" virtualized=true appearance="none" estimated-item-height=120 flex=1 min-height=0 aria-label=label testId=`${id}-list`
|
|
39
|
+
for day in (loading ? [] : days) key=day
|
|
40
|
+
column padding="8px 16px" gap=4 testId=`${id}-day-${day}`
|
|
41
|
+
text (day == today ? `${strings.today} · ${dayTitle(names, day)}` : dayTitle(names, day)) role="heading" aria-level=3 font="-exact-footnote" font-weight=600 color=(day == today ? "AccentColor" : "-exact-secondary-label") padding="4px 0" testId=`${id}-title-${day}`
|
|
42
|
+
for s in segments.filter(x => x.day == day) key=s.key
|
|
43
|
+
AgendaEvent(segment=s, press=one(s.id), testId=`${id}-event-${s.key}`)
|
|
44
|
+
|
|
45
|
+
component AgendaEvent
|
|
46
|
+
props
|
|
47
|
+
segment: SchedulerSegment
|
|
48
|
+
press: action
|
|
49
|
+
testId: string
|
|
50
|
+
derive s = segment
|
|
51
|
+
view
|
|
52
|
+
button press=press aria-label=[s.title, s.time, s.detail].filter(x => x != "").join(", ") appearance="none" display="flex" flex-direction="row" align-items="stretch" gap=10 padding="8px 12px" min-height=48 width="100%" box-sizing="border-box" border-radius=12 background-color="-exact-secondary-background" testId=testId
|
|
53
|
+
view width=4 border-radius=2 flex-shrink=0 background-color=tintOf(s.tint) aria-hidden=true
|
|
54
|
+
column flex=1 min-width=0 gap=2 align-items="flex-start" justify-content="center" aria-hidden=true
|
|
55
|
+
text s.title font="-exact-body" color="-exact-label" text-align="start" overflow-wrap="anywhere"
|
|
56
|
+
text [s.time, s.detail].filter(x => x != "").join(" · ") font="-exact-footnote" color="-exact-label" text-align="start" overflow-wrap="anywhere"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// exact-scheduler: day keys and their arithmetic, as functions an app may
|
|
2
|
+
// call too. A key is "YYYY-MM-DD" in the Gregorian calendar, so keys compare
|
|
3
|
+
// as text in date order.
|
|
4
|
+
|
|
5
|
+
use SchedulerRules, SchedulerRange from "./shapes.contract"
|
|
6
|
+
|
|
7
|
+
fn whole(s: string): number = match parseNumber(s) { case some(n) => n, case none => 0 }
|
|
8
|
+
fn yearOf(day: string): number = whole(day.slice(0, 4))
|
|
9
|
+
// The month, 0 (January) to 11.
|
|
10
|
+
fn monthIndexOf(day: string): number = whole(day.slice(5, 7)) - 1
|
|
11
|
+
fn dateOf(day: string): number = whole(day.slice(8, 10))
|
|
12
|
+
// A day's month as a key: "2026-11".
|
|
13
|
+
fn monthOf(day: string): string = day.slice(0, 7)
|
|
14
|
+
|
|
15
|
+
// Days since 1970-01-01 of a date (Howard Hinnant's days_from_civil): `y` is
|
|
16
|
+
// the year counted from March, `m` the month (0 is January).
|
|
17
|
+
fn civil(y: number, m: number, d: number): number = floor(y / 400) * 146097 + (y - floor(y / 400) * 400) * 365 + floor((y - floor(y / 400) * 400) / 4) - floor((y - floor(y / 400) * 400) / 100) + floor((153 * ((m + 10) % 12) + 2) / 5) + d - 1 - 719468
|
|
18
|
+
fn civilDay(y: number, m: number, d: number): number = civil((m < 2 ? y - 1 : y), m, d)
|
|
19
|
+
|
|
20
|
+
// A day's number (days since 1970-01-01), and the key of a number.
|
|
21
|
+
fn dayNumber(day: string): number = civilDay(yearOf(day), monthIndexOf(day), dateOf(day))
|
|
22
|
+
fn dayKeyOf(n: number): string = formatDate(n * 86400000, 0, "iso")
|
|
23
|
+
fn addDays(day: string, n: number): string = dayKeyOf(dayNumber(day) + n)
|
|
24
|
+
|
|
25
|
+
fn mod(a: number, b: number): number = (a % b + b) % b
|
|
26
|
+
// 0 is Sunday.
|
|
27
|
+
fn weekdayOf(day: string): number = mod(dayNumber(day) + 4, 7)
|
|
28
|
+
fn startOfWeek(day: string, firstDay: number): string = addDays(day, 0 - mod(weekdayOf(day) - firstDay, 7))
|
|
29
|
+
|
|
30
|
+
// A month is counted as years * 12 + month.
|
|
31
|
+
fn monthCount(day: string): number = yearOf(day) * 12 + monthIndexOf(day)
|
|
32
|
+
fn monthStart(count: number): number = civilDay(floor(count / 12), mod(count, 12), 1)
|
|
33
|
+
fn daysInMonth(day: string): number = monthStart(monthCount(day) + 1) - monthStart(monthCount(day))
|
|
34
|
+
// The same date `n` months away, or that month's last day.
|
|
35
|
+
fn addMonths(day: string, n: number): string = dayKeyOf(min(monthStart(monthCount(day) + n) + dateOf(day) - 1, monthStart(monthCount(day) + n + 1) - 1))
|
|
36
|
+
|
|
37
|
+
// ISO 8601's week number of the week a day is in.
|
|
38
|
+
fn weekNumberOf(day: string): number = isoWeek(dayNumber(day) - mod(dayNumber(day) + 3, 7) + 3)
|
|
39
|
+
fn isoWeek(thursday: number): number = floor((thursday - civilDay(yearOf(dayKeyOf(thursday)), 0, 1)) / 7) + 1
|
|
40
|
+
|
|
41
|
+
// The days of a month's grid in whole weeks: the month's own (four to six
|
|
42
|
+
// weeks), with the neighbours' days that fill the first and the last.
|
|
43
|
+
fn monthDays(month: string, firstDay: number): string[] = gridFrom(dayNumber(`${monthOf(month)}-01`), mod(weekdayOf(`${monthOf(month)}-01`) - firstDay, 7), daysInMonth(`${monthOf(month)}-01`))
|
|
44
|
+
fn gridFrom(first: number, lead: number, days: number): string[] = range(ceil((lead + days) / 7) * 7).map(i => dayKeyOf(first - lead + i))
|
|
45
|
+
|
|
46
|
+
// Rules that allow every day.
|
|
47
|
+
fn anyDay(): SchedulerRules = SchedulerRules(minDay="", maxDay="", disabledDays=[], disabledWeekdays=[])
|
|
48
|
+
fn withinLimits(rules: SchedulerRules, day: string): bool = (rules.minDay == "" or day >= rules.minDay) and (rules.maxDay == "" or day <= rules.maxDay)
|
|
49
|
+
fn dayAllowed(rules: SchedulerRules, day: string): bool = withinLimits(rules, day) and not rules.disabledDays.includes(day) and not rules.disabledWeekdays.includes(weekdayOf(day))
|
|
50
|
+
// Whether a month ("2026-11") has a day inside the limits.
|
|
51
|
+
fn monthAllowed(rules: SchedulerRules, month: string): bool = (rules.minDay == "" or month >= monthOf(rules.minDay)) and (rules.maxDay == "" or month <= monthOf(rules.maxDay))
|
|
52
|
+
// Whether the arrows may turn to a month: back as far as the first limit,
|
|
53
|
+
// on as far as the last, so a page outside the limits can be left.
|
|
54
|
+
fn canTurn(rules: SchedulerRules, month: string, n: number): bool = n < 0 ? (rules.minDay == "" or month >= monthOf(rules.minDay)) : (rules.maxDay == "" or month <= monthOf(rules.maxDay))
|
|
55
|
+
fn clampDay(rules: SchedulerRules, day: string): string = (rules.minDay != "" and day < rules.minDay) ? rules.minDay : ((rules.maxDay != "" and day > rules.maxDay) ? rules.maxDay : day)
|
|
56
|
+
|
|
57
|
+
fn inRange(r: SchedulerRange, day: string): bool = r.start != "" and r.end != "" and day >= r.start and day <= r.end
|
|
58
|
+
// The days from one key to another, both in it.
|
|
59
|
+
fn daysBetween(from: string, to: string): string[] = range(max(0, dayNumber(to) - dayNumber(from) + 1)).map(i => addDays(from, i))
|
|
60
|
+
fn clearOf(rules: SchedulerRules, from: string, to: string): bool = daysBetween(from, to).filter(d => not dayAllowed(rules, d)).length == 0
|
|
61
|
+
// A range after a day is pressed: the first press starts it, a press on or
|
|
62
|
+
// after the start ends it, and any other starts again. A range over a day
|
|
63
|
+
// the rules refuse, or longer than `maxDays` (0 for no limit), starts again
|
|
64
|
+
// at the pressed day.
|
|
65
|
+
fn nextRange(r: SchedulerRange, day: string, rules: SchedulerRules, maxDays: number): SchedulerRange = (r.start != "" and r.end == "" and day >= r.start and (maxDays <= 0 or dayNumber(day) - dayNumber(r.start) < maxDays) and clearOf(rules, r.start, day)) ? SchedulerRange(start=r.start, end=day) : SchedulerRange(start=day, end="")
|
|
66
|
+
|
|
67
|
+
// The day a key moves the focus to in a month grid, or "" for another key.
|
|
68
|
+
fn moveDay(k: string, day: string, firstDay: number, rtl: bool): string = k == "ArrowRight" ? addDays(day, (rtl ? -1 : 1)) : (k == "ArrowLeft" ? addDays(day, (rtl ? 1 : -1)) : (k == "ArrowDown" ? addDays(day, 7) : (k == "ArrowUp" ? addDays(day, -7) : (k == "Home" ? startOfWeek(day, firstDay) : (k == "End" ? addDays(startOfWeek(day, firstDay), 6) : (k == "PageDown" ? addMonths(day, 1) : (k == "PageUp" ? addMonths(day, -1) : "")))))))
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// exact-scheduler: a month with its events written in the days, for a wide
|
|
2
|
+
// window. On a phone, a `MonthCalendar` with dots over an `Agenda` reads
|
|
3
|
+
// better.
|
|
4
|
+
|
|
5
|
+
use SchedulerNames, SchedulerStrings, SchedulerRules, SchedulerSegment, SchedulerViewport from "./shapes.contract"
|
|
6
|
+
use monthDays, monthOf, dateOf, addMonths, canTurn, weekdayOf from "./days.contract"
|
|
7
|
+
use monthTitle, dayWords, localDigits, weekWords, moreText from "./text.contract"
|
|
8
|
+
use SchedulerBar, SchedulerWeekdays, SchedulerChip, pageMotion, schedulerForward, schedulerBackward from "./parts.contract"
|
|
9
|
+
|
|
10
|
+
component MonthSchedule
|
|
11
|
+
props
|
|
12
|
+
id: string
|
|
13
|
+
month: string
|
|
14
|
+
today: string
|
|
15
|
+
segments: SchedulerSegment[]
|
|
16
|
+
rules: SchedulerRules
|
|
17
|
+
names: SchedulerNames
|
|
18
|
+
strings: SchedulerStrings
|
|
19
|
+
label: string
|
|
20
|
+
maxEvents: number
|
|
21
|
+
rtl: bool
|
|
22
|
+
pick: action
|
|
23
|
+
pressEvent: action
|
|
24
|
+
turnTo: action
|
|
25
|
+
resource screen = exactViewport() as shape SchedulerViewport
|
|
26
|
+
state step = 0
|
|
27
|
+
derive days = monthDays(month, names.firstDay)
|
|
28
|
+
action turn(n: number)
|
|
29
|
+
let next = addMonths(`${monthOf(month)}-01`, n)
|
|
30
|
+
if canTurn(rules, monthOf(next), n)
|
|
31
|
+
step = n
|
|
32
|
+
turnTo(next)
|
|
33
|
+
action unused
|
|
34
|
+
step = 0
|
|
35
|
+
action pickDay(day: string)
|
|
36
|
+
pick(day)
|
|
37
|
+
action pressOne(eventId: string)
|
|
38
|
+
pressEvent(eventId)
|
|
39
|
+
view
|
|
40
|
+
column gap=4 testId=id
|
|
41
|
+
SchedulerBar(id=id, title=monthTitle(names, month), titleLabel="", previousLabel=strings.previousMonth, nextLabel=strings.nextMonth, canPrevious=canTurn(rules, monthOf(addMonths(`${monthOf(month)}-01`, -1)), -1), canNext=canTurn(rules, monthOf(addMonths(`${monthOf(month)}-01`, 1)), 1), opens=false, expanded=false, previous=turn(-1), next=turn(1), open=unused)
|
|
42
|
+
column role="table" aria-label=`${label}, ${monthTitle(names, month)}` testId=`${id}-grid`
|
|
43
|
+
SchedulerWeekdays(names=names, numbers=false, short=true)
|
|
44
|
+
for page in [monthOf(month)] key=page
|
|
45
|
+
column animation=pageMotion(screen.prefersReducedMotion, step, rtl) border-top="1px solid -exact-separator"
|
|
46
|
+
for w in range(days.length / 7) key=`${w}`
|
|
47
|
+
row role="row" aria-label=weekWords(names, strings, days, w) align-items="stretch" border-bottom="1px solid -exact-separator"
|
|
48
|
+
for day in days.slice(w * 7, w * 7 + 7) key=day
|
|
49
|
+
MonthScheduleDay(id=id, day=day, today=today, inside=(monthOf(day) == monthOf(month)), segments=segments.filter(s => s.day == day), names=names, strings=strings, maxEvents=maxEvents, rtl=rtl, pick=pickDay(day), pressEvent=pressOne)
|
|
50
|
+
|
|
51
|
+
component MonthScheduleDay
|
|
52
|
+
props
|
|
53
|
+
id: string
|
|
54
|
+
day: string
|
|
55
|
+
today: string
|
|
56
|
+
inside: bool
|
|
57
|
+
segments: SchedulerSegment[]
|
|
58
|
+
names: SchedulerNames
|
|
59
|
+
strings: SchedulerStrings
|
|
60
|
+
maxEvents: number
|
|
61
|
+
rtl: bool
|
|
62
|
+
pick: action
|
|
63
|
+
pressEvent: action
|
|
64
|
+
action one(eventId: string)
|
|
65
|
+
pressEvent(eventId)
|
|
66
|
+
view
|
|
67
|
+
column role="cell" flex="1 1 0%" min-width=0 min-height=104 gap=2 padding=2 box-sizing="border-box" background-color=(names.weekend.includes(weekdayOf(day)) ? "-exact-quaternary-fill" : "transparent") testId=`${id}-cell-${day}`
|
|
68
|
+
button press=pick aria-label=dayWords(names, day, [(day == today ? strings.today : "")]) aria-current=(day == today ? "date" : "false") appearance="none" background-color=(day == today ? "AccentColor" : "transparent") align-self="flex-end" min-width=28 min-height=28 padding="0 4px" border-radius=14 display="flex" align-items="center" justify-content="center" testId=`${id}-day-${day}`
|
|
69
|
+
text localDigits(names.digits, dateOf(day)) font-size="min(-exact-footnote, 16px)" font-variant-numeric="tabular-nums" color=(day == today ? "AccentColorText" : (inside ? "-exact-label" : "-exact-secondary-label")) aria-hidden=true
|
|
70
|
+
for s in segments.slice(0, maxEvents) key=s.key
|
|
71
|
+
SchedulerChip(segment=s, rtl=rtl, press=one(s.id), testId=`${id}-event-${s.key}`)
|
|
72
|
+
if segments.length > maxEvents
|
|
73
|
+
button press=pick aria-label=dayWords(names, day, [moreText(strings, names, segments.length - maxEvents)]) appearance="none" background-color="transparent" min-height=24 padding="0 4px" display="flex" align-items="center" testId=`${id}-more-${day}`
|
|
74
|
+
text moreText(strings, names, segments.length - maxEvents) font-size="min(-exact-caption1, 14px)" color="-exact-secondary-label" aria-hidden=true
|