From 425ac815c8884d1a0ab912fddf58d3199de1ed1e Mon Sep 17 00:00:00 2001 From: Rafael Bardini Date: Mon, 9 Sep 2024 19:33:08 +0200 Subject: [PATCH] refactor(date): rename `Date` component `DateTime` --- components/awards.js | 4 ++-- components/certificates.js | 4 ++-- components/{date.js => date-time.js} | 2 +- components/duration.js | 6 +++--- components/publications.js | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) rename components/{date.js => date-time.js} (90%) diff --git a/components/awards.js b/components/awards.js index 9cdba15..3e932d7 100644 --- a/components/awards.js +++ b/components/awards.js @@ -1,6 +1,6 @@ import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' -import Date from './date.js' +import DateTime from './date-time.js' /** * @param {import('../schema.d.ts').ResumeSchema['awards']} awards @@ -19,7 +19,7 @@ export default function Awards(awards = []) {

${title}

- ${awarder && html`
Awarded by ${awarder}
`} ${date && Date(date)} + ${awarder && html`
Awarded by ${awarder}
`} ${date && DateTime(date)}
${summary && markdown(summary)} diff --git a/components/certificates.js b/components/certificates.js index 9c39bc5..960e8c5 100644 --- a/components/certificates.js +++ b/components/certificates.js @@ -1,5 +1,5 @@ import { html } from '@rbardini/html' -import Date from './date.js' +import DateTime from './date-time.js' import Link from './link.js' /** @@ -19,7 +19,7 @@ export default function Certificates(certificates = []) {

${Link(url, name)}

- ${issuer && html`
Issued by ${issuer}
`} ${date && Date(date)} + ${issuer && html`
Issued by ${issuer}
`} ${date && DateTime(date)}
diff --git a/components/date.js b/components/date-time.js similarity index 90% rename from components/date.js rename to components/date-time.js index 0f0c6be..01435de 100644 --- a/components/date.js +++ b/components/date-time.js @@ -15,6 +15,6 @@ const formatDate = dateString => * @param {string} date * @returns {string} */ -export default function Duration(date) { +export default function DateTime(date) { return html`` } diff --git a/components/duration.js b/components/duration.js index 40b510e..afb32c1 100644 --- a/components/duration.js +++ b/components/duration.js @@ -1,5 +1,5 @@ import { html } from '@rbardini/html' -import Date from './date.js' +import DateTime from './date-time.js' /** * @param {string} startDate @@ -7,6 +7,6 @@ import Date from './date.js' * @returns {string} */ export default function Duration(startDate, endDate) { - if (endDate === startDate) return Date(endDate) - return html`${Date(startDate)} – ${endDate ? Date(endDate) : 'Present'}` + if (endDate === startDate) return DateTime(endDate) + return html`${DateTime(startDate)} – ${endDate ? DateTime(endDate) : 'Present'}` } diff --git a/components/publications.js b/components/publications.js index fc85b43..270e869 100644 --- a/components/publications.js +++ b/components/publications.js @@ -1,6 +1,6 @@ import { html } from '@rbardini/html' import markdown from '../utils/markdown.js' -import Date from './date.js' +import DateTime from './date-time.js' import Link from './link.js' /** @@ -21,7 +21,7 @@ export default function Publications(publications = []) {

${Link(url, name)}

${publisher && html`
Published by ${publisher}
`} - ${releaseDate && Date(releaseDate)} + ${releaseDate && DateTime(releaseDate)}
${summary && markdown(summary)}