@sarimarcus/content-sites-ui 0.52.0 → 0.53.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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.53.0 (2026-10-29)
6
+
7
+ - `ArticleMetadata`: the byline prints the day only, no time of day (the `<time datetime>` keeps the full stamp), with "Published" after "Updated" on one line; "Updated" is dropped when both stamps print the same day. Output changes on every article, guide, discover, plan and itinerary page (SLA-3590).
8
+
9
+ ## 0.52.1 (2026-10-28)
10
+
11
+ - Lockstep release, no change (SLA-3566).
12
+
5
13
  ## 0.52.0 (2026-10-27)
6
14
 
7
15
  - Lockstep release, no change (SLA-3517).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-ui",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "description": "Universal Astro UI components, layout shell and design tokens shared by the content sites.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -50,6 +50,6 @@
50
50
  "@lucide/astro": "^1.23.0",
51
51
  "astro": "^7.0.6",
52
52
  "tailwindcss": "^4.1.18",
53
- "@sarimarcus/content-sites-core": "0.52.0"
53
+ "@sarimarcus/content-sites-core": "0.53.0"
54
54
  }
55
55
  }
@@ -6,15 +6,17 @@
6
6
  * the optimised portrait (or a photo URL) and the credentials. No author renders no byline and no avatar; a site
7
7
  * that wants a brand byline passes it as an author.
8
8
  *
9
- * Dates: most callers pass a date-only value (only articles carry a real HH:MM), so a time is printed only when the
10
- * input has one, in `timeZone`; a date-only value always prints its UTC calendar day. "Updated" leads when the two
11
- * dates fall on different calendar days, since recency is what a reader and a crawler look for.
9
+ * Dates: only the calendar day is printed (the `<time datetime>` keeps the full value for crawlers). A value that
10
+ * carries a time prints its day in `timeZone`; a date-only value prints its UTC day. "Updated" leads when the two
11
+ * dates fall on different calendar days, since recency is what a reader and a crawler look for; "Published" follows
12
+ * on the same line.
12
13
  *
13
14
  * The `\n`-prefixed labels and `bylineLead` reproduce the text nodes the sites' templates compile to, so adoption
14
15
  * changes no byte.
15
16
  */
16
17
  import { Image } from 'astro:assets';
17
18
  import { isUpdatedAfterPublication } from '@sarimarcus/content-sites-core/articles';
19
+ import { formatDisplayDay } from '@sarimarcus/content-sites-core/dates';
18
20
  import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
19
21
  import EraChip from '../editorial/EraChip.astro';
20
22
  import type { ArticleAuthor } from './types';
@@ -63,30 +65,10 @@ const {
63
65
  } = Astro.props;
64
66
  const { era: _era, eraBasePath: _eraBasePath, ...bylineProps } = Astro.props;
65
67
 
66
- function formatDate(dateStr: string | undefined): string {
67
- if (!dateStr) return '';
68
-
69
- const date = new Date(dateStr);
70
- return dateStr.includes('T')
71
- ? date.toLocaleString(locale, {
72
- year: 'numeric',
73
- month: 'long',
74
- day: 'numeric',
75
- hour: '2-digit',
76
- minute: '2-digit',
77
- timeZone,
78
- })
79
- : date.toLocaleDateString(locale, {
80
- year: 'numeric',
81
- month: 'long',
82
- day: 'numeric',
83
- timeZone: 'UTC',
84
- });
85
- }
86
-
87
- const publishedFormatted = formatDate(datePublished);
88
- const modifiedFormatted = formatDate(dateModified);
89
- const showModified = isUpdatedAfterPublication({ datePublished, dateModified });
68
+ const publishedFormatted = formatDisplayDay(datePublished, locale, timeZone);
69
+ const modifiedFormatted = formatDisplayDay(dateModified, locale, timeZone);
70
+ // Two stamps that print the same day (a zone shift) show one date, not "Updated 3 April · Published 3 April".
71
+ const showModified = isUpdatedAfterPublication({ datePublished, dateModified }) && modifiedFormatted !== publishedFormatted;
90
72
 
91
73
  const name = author?.name;
92
74
  const portraitAlt = `${portraitLabel} ${name}`;
@@ -153,7 +135,7 @@ const bylineLead = author ? (grouped ? ' ' : ' ') : (grouped ? '' : ' ');
153
135
  </span>
154
136
  )}
155
137
  {showModified && publishedFormatted && (
156
- <span>{publishedLabel} <time datetime={datePublished}>{publishedFormatted}</time></span>
138
+ <span><span aria-hidden="true">·</span> {publishedLabel} <time datetime={datePublished}>{publishedFormatted}</time></span>
157
139
  )}
158
140
  </div>
159
141
  </div>