@claudinho/core 0.8.3 → 0.8.4
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/dist/index.d.ts +3 -1
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -146,8 +146,10 @@ declare function resolveTz(explicit?: string): string | undefined;
|
|
|
146
146
|
interface FormatOpts {
|
|
147
147
|
tz?: string;
|
|
148
148
|
locale?: string;
|
|
149
|
+
/** Include month and day (for multi-week schedules like the knockout bracket). */
|
|
150
|
+
date?: boolean;
|
|
149
151
|
}
|
|
150
|
-
/** Format a kickoff like "Thu 19:00"
|
|
152
|
+
/** Format a kickoff like "Thu 19:00", or "Sat, Jul 4, 17:00" when `date` is set. */
|
|
151
153
|
declare function formatKickoff(iso: string, opts?: FormatOpts): string;
|
|
152
154
|
/** A short calendar date like "Jun 11" in the target timezone/locale. */
|
|
153
155
|
declare function formatDate(iso: string, opts?: FormatOpts): string;
|
package/dist/index.js
CHANGED
|
@@ -451,6 +451,7 @@ function formatKickoff(iso, opts = {}) {
|
|
|
451
451
|
const locale = safeLocale(opts.locale);
|
|
452
452
|
return new Intl.DateTimeFormat(locale, {
|
|
453
453
|
weekday: "short",
|
|
454
|
+
...opts.date ? { month: "short", day: "numeric" } : {},
|
|
454
455
|
hour: "2-digit",
|
|
455
456
|
minute: "2-digit",
|
|
456
457
|
hour12: false,
|
|
@@ -4732,6 +4733,9 @@ function statusTail2(m) {
|
|
|
4732
4733
|
if (isLive(m.status)) return " LIVE";
|
|
4733
4734
|
return "";
|
|
4734
4735
|
}
|
|
4736
|
+
function formatBracketKickoff(iso, opts) {
|
|
4737
|
+
return formatKickoff(iso, { tz: opts.tz, locale: opts.locale, date: true });
|
|
4738
|
+
}
|
|
4735
4739
|
function formatBracketMatchLine(mv, opts = {}) {
|
|
4736
4740
|
const flags = opts.flags !== false;
|
|
4737
4741
|
const home = formatParticipant(mv.home, "home", flags, opts.locale);
|
|
@@ -4740,7 +4744,7 @@ function formatBracketMatchLine(mv, opts = {}) {
|
|
|
4740
4744
|
if (isFinished(m.status) || isLive(m.status)) {
|
|
4741
4745
|
return ` ${home} ${scoreline(m)} ${away}${statusTail2(m)}`;
|
|
4742
4746
|
}
|
|
4743
|
-
const kickoff = mv.kickoff ?
|
|
4747
|
+
const kickoff = mv.kickoff ? formatBracketKickoff(mv.kickoff, opts) : "";
|
|
4744
4748
|
return ` ${home} vs ${away}${kickoff ? ` \xB7 ${kickoff}` : ""}`;
|
|
4745
4749
|
}
|
|
4746
4750
|
function formatBracketList(view, opts = {}) {
|
|
@@ -4837,7 +4841,7 @@ function formatBracketCompactLine(mv, opts = {}) {
|
|
|
4837
4841
|
const away = formatParticipant(mv.away, "away", flags, opts.locale);
|
|
4838
4842
|
const m = mv.match;
|
|
4839
4843
|
const mid2 = isFinished(m.status) || isLive(m.status) ? scoreline(m) : "vs";
|
|
4840
|
-
const tail = m.status === "SCHEDULED" && mv.kickoff ? ` \xB7 ${
|
|
4844
|
+
const tail = m.status === "SCHEDULED" && mv.kickoff ? ` \xB7 ${formatBracketKickoff(mv.kickoff, opts)}` : statusTail2(m);
|
|
4841
4845
|
return `${stageLabelI18n(opts.locale, mv.stage)} \xB7 ${home} ${mid2} ${away}${tail}`;
|
|
4842
4846
|
}
|
|
4843
4847
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudinho/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "Domain model, provider adapters (ESPN), standings, bundled schedule, and the read-only Polymarket market-signal sidecar powering Claudinho. Not affiliated with FIFA or Anthropic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|