mirror of
https://github.com/quartz-community/recent-notes.git
synced 2026-07-22 02:50:28 +00:00
fix: guard against undefined getDate in RecentNotes
This commit is contained in:
parent
87dc109cbb
commit
25455b5ef9
5 changed files with 8 additions and 8 deletions
4
dist/components/index.js
vendored
4
dist/components/index.js
vendored
|
|
@ -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/components/index.js.map
vendored
2
dist/components/index.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/index.js
vendored
4
dist/index.js
vendored
|
|
@ -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
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -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))!,
|
||||
|
|
|
|||
Loading…
Reference in a new issue