astro-accelerator 5.10.40 → 5.10.41

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.10.40",
2
+ "version": "5.10.41",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -36,11 +36,11 @@
36
36
  "dependencies": {
37
37
  "@astrojs/mdx": "^4.3.13",
38
38
  "@img/sharp-linux-x64": "^0.34.5",
39
- "astro": "^5.17.0",
39
+ "astro": "^5.17.2",
40
40
  "astro-accelerator-utils": "^0.3.69",
41
- "cspell": "^9.6.2",
41
+ "cspell": "^9.6.4",
42
42
  "csv": "^6.4.1",
43
- "glob": "^13.0.0",
43
+ "glob": "^13.0.3",
44
44
  "hast-util-from-selector": "^3.0.1",
45
45
  "html-to-text": "^9.0.5",
46
46
  "keyword-extractor": "^0.0.28",
@@ -50,7 +50,7 @@
50
50
  "sharp": "^0.34.5"
51
51
  },
52
52
  "devDependencies": {
53
- "@playwright/test": "^1.58.0"
53
+ "@playwright/test": "^1.58.2"
54
54
  },
55
55
  "files": [
56
56
  ".npmrc",
@@ -23,22 +23,30 @@ threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
23
23
 
24
24
  const isOld = eventDate < threeMonthsAgo;
25
25
 
26
- const displayDate = isOld
27
- ? accelerator.dateFormatter.formatDateWithoutDay(date, SITE.default.locale)
28
- : accelerator.dateFormatter.formatShortDate(date, SITE.default.locale);
26
+ const formatDate = (d) => {
27
+ try {
28
+ return isOld
29
+ ? accelerator.dateFormatter.formatDateWithoutDay(
30
+ d,
31
+ SITE.default.locale,
32
+ )
33
+ : accelerator.dateFormatter.formatShortDate(d, SITE.default.locale);
34
+ } catch (e) {
35
+ return new Date(d).toLocaleDateString(SITE.default.locale);
36
+ }
37
+ };
38
+
39
+ const displayDate = formatDate(date);
29
40
  ---
30
41
 
31
42
  <div class="timeline-event">
32
43
  <div>
33
- <time datetime={date}>{displayDate}</time>{
44
+ <time datetime={date.toString()}>{displayDate}</time>{
34
45
  !isOld && endDate && (
35
46
  <Fragment>
36
47
  &dash;
37
- <time datetime={endDate}>
38
- {accelerator.dateFormatter.formatShortDate(
39
- endDate,
40
- SITE.default.locale,
41
- )}
48
+ <time datetime={endDate.toString()}>
49
+ {formatDate(endDate)}
42
50
  </time>
43
51
  </Fragment>
44
52
  )
@@ -50,7 +58,7 @@ const displayDate = isOld
50
58
  {
51
59
  linkHref && (
52
60
  <a href={linkHref} class="button">
53
- {linkText}
61
+ {linkText || "Link"}
54
62
  </a>
55
63
  )
56
64
  }