fix: guard against undefined getDate in RecentNotes

This commit is contained in:
saberzero1 2026-04-03 16:01:38 +02:00
parent 87dc109cbb
commit 25455b5ef9
No known key found for this signature in database
5 changed files with 8 additions and 8 deletions

View file

@ -83,12 +83,12 @@ var RecentNotes_default = ((userOpts) => {
const tags = page.frontmatter?.tags ?? [];
return /* @__PURE__ */ jsx("li", { class: "recent-li", children: /* @__PURE__ */ jsxs("div", { class: "section", children: [
/* @__PURE__ */ jsx("div", { class: "desc", children: /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx("a", { href: resolveRelative(slug, page.slug), class: "internal", children: title }) }) }),
page.dates && /* @__PURE__ */ jsx("p", { class: "meta", children: /* @__PURE__ */ jsx(
page.dates && getDate(withDefaultDateType(page, globalCfg.defaultDateType)) && /* @__PURE__ */ jsx("p", { class: "meta", children: /* @__PURE__ */ jsx(
"time",
{
datetime: getDate(
withDefaultDateType(page, globalCfg.defaultDateType)
)?.toISOString(),
).toISOString(),
children: formatDate(
getDate(withDefaultDateType(page, globalCfg.defaultDateType)),
locale

File diff suppressed because one or more lines are too long

4
dist/index.js vendored
View file

@ -83,12 +83,12 @@ var RecentNotes_default = ((userOpts) => {
const tags = page.frontmatter?.tags ?? [];
return /* @__PURE__ */ jsx("li", { class: "recent-li", children: /* @__PURE__ */ jsxs("div", { class: "section", children: [
/* @__PURE__ */ jsx("div", { class: "desc", children: /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx("a", { href: resolveRelative(slug, page.slug), class: "internal", children: title }) }) }),
page.dates && /* @__PURE__ */ jsx("p", { class: "meta", children: /* @__PURE__ */ jsx(
page.dates && getDate(withDefaultDateType(page, globalCfg.defaultDateType)) && /* @__PURE__ */ jsx("p", { class: "meta", children: /* @__PURE__ */ jsx(
"time",
{
datetime: getDate(
withDefaultDateType(page, globalCfg.defaultDateType)
)?.toISOString(),
).toISOString(),
children: formatDate(
getDate(withDefaultDateType(page, globalCfg.defaultDateType)),
locale

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -99,12 +99,12 @@ export default ((userOpts?: Partial<RecentNotesOptions>) => {
</a>
</h3>
</div>
{page.dates && (
{page.dates && getDate(withDefaultDateType(page, globalCfg.defaultDateType)) && (
<p class="meta">
<time
datetime={getDate(
withDefaultDateType(page, globalCfg.defaultDateType),
)?.toISOString()}
)!.toISOString()}
>
{formatDate(
getDate(withDefaultDateType(page, globalCfg.defaultDateType))!,