Skip to content

Commit 837d31c

Browse files
committed
Update date formats to include timezone offset for lymphoma entries and enhance date display in components
- Modified date formats in multiple markdown files to include timezone offset (-04:00). - Added a new markdown entry for the first day of the first cycle of K-GEMOX treatment. - Refactored date handling in Svelte components to utilize a new PostDate component for consistent date formatting.
1 parent e588148 commit 837d31c

71 files changed

Lines changed: 183 additions & 112 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎package-lock.json‎

Lines changed: 41 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
"yargs-parser": "^22.0.0"
6363
},
6464
"overrides": {
65-
"cookie": "^1.0.0",
66-
"js-yaml": "^4.2.0"
65+
"cookie": "^1.0.0"
6766
},
6867
"lint-staged": {
6968
"*.{ts,js,svelte,md}": "prettier --write"

‎src/lib/components/PostDate.svelte‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<script lang="ts">
2+
import { onMount } from 'svelte'
3+
4+
let { date }: { date: string } = $props()
5+
6+
const AUTHOR_TZ = 'America/Santo_Domingo'
7+
8+
const parsedDate = $derived(new Date(date))
9+
10+
const ssrFormatted = $derived(
11+
new Intl.DateTimeFormat('en-US', {
12+
year: 'numeric',
13+
month: 'long',
14+
day: 'numeric',
15+
timeZone: AUTHOR_TZ
16+
}).format(parsedDate)
17+
)
18+
19+
let clientFormatted = $state<string | null>(null)
20+
let clientTooltip = $state<string | null>(null)
21+
22+
onMount(() => {
23+
clientFormatted = new Intl.DateTimeFormat(undefined, {
24+
year: 'numeric',
25+
month: 'long',
26+
day: 'numeric'
27+
}).format(parsedDate)
28+
29+
clientTooltip = new Intl.DateTimeFormat(undefined, {
30+
year: 'numeric',
31+
month: 'long',
32+
day: 'numeric',
33+
hour: 'numeric',
34+
minute: '2-digit',
35+
timeZoneName: 'long'
36+
}).format(parsedDate)
37+
})
38+
</script>
39+
40+
<time datetime={date} title={clientTooltip ?? undefined}
41+
>{clientFormatted ?? ssrFormatted}</time
42+
>

‎src/lib/components/SEO.svelte‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
description = '',
1010
image = { src: '/images/icon.png', width: 1040, height: 1040 },
1111
breadcrumbs = [],
12-
noIndex = false
12+
noIndex = false,
13+
publishedTime
1314
}: {
1415
title: string
1516
description?: string
1617
image?: Image
1718
breadcrumbs?: Breadcrumb[]
1819
noIndex?: boolean
20+
publishedTime?: string
1921
} = $props()
2022
2123
const metaDescription = $derived(description || site.description)
@@ -48,7 +50,10 @@
4850
<meta name="keywords" content={site.keywords.join(',')} />
4951
<meta property="og:title" content={title} />
5052
<meta property="og:description" content={metaDescription} />
51-
<meta property="og:type" content="website" />
53+
<meta property="og:type" content={publishedTime ? 'article' : 'website'} />
54+
{#if publishedTime}
55+
<meta property="article:published_time" content={publishedTime} />
56+
{/if}
5257
<meta name="twitter:creator" content={site.author} />
5358
<meta name="twitter:title" content={title} />
5459
<meta name="twitter:description" content={metaDescription} />

‎src/lib/date.ts‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎src/markdown/code/guide-node-cli-package.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: 2017-08-18T11:47:25.000
2+
date: 2017-08-18T11:47:25.000-04:00
33
title: 'Guide: creating a NodeJS command-line package'
44
slug: /code/guide-create-a-node-js-command-line-package
55
---

‎src/markdown/code/snippet-remove-old-node-modules.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: 2020-11-13T09:30:00.000
2+
date: 2020-11-13T09:30:00.000-04:00
33
title: 'Remove old node modules to claim space'
44
slug: /code/remove-old-node-modules-directories
55
---

‎src/markdown/lymphoma/2015-09-01.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: 2015-09-01T04:00:00.000
2+
date: 2015-09-01T04:00:00.000-04:00
33
title: 'A small ball'
44
chapter: 1
55
slug: /lymphoma/2015-09-01

‎src/markdown/lymphoma/2016-03-03.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: 2016-03-03T05:00:00.000
2+
date: 2016-03-03T05:00:00.000-04:00
33
title: 'Otorhinolaryngologist appointment'
44
chapter: 1
55
slug: /lymphoma/2016-03-03

‎src/markdown/lymphoma/2016-03-04.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: 2016-03-04T05:00:00.000
2+
date: 2016-03-04T05:00:00.000-04:00
33
title: 'Friday, March 4, 2016'
44
chapter: 1
55
slug: /lymphoma/2016-03-04

0 commit comments

Comments
 (0)