Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

monograph: fix `Use `yyyy` instead of `YYYY``

Abdullah Attaed16143a2ce0
diff --git a/apps/monograph/app/routes/$id.tsx b/apps/monograph/app/routes/$id.tsx
index 8d8841ce6..ab54af03d 100644
--- a/apps/monograph/app/routes/$id.tsx
+++ b/apps/monograph/app/routes/$id.tsx
@@ -184,7 +184,7 @@ function getMonographMetadata(monograph?: Monograph): Metadata {
const shortDescription = trimDescription(text, 150, true);
const fullDescription = trimDescription(text, 300, true);
const datePublished = monograph
- ? format(monograph.datePublished, "YYYY-MM-dd HH:mm")
+ ? format(monograph.datePublished, "yyyy-MM-dd HH:mm")
: "";
return {
title,
diff --git a/apps/monograph/app/utils/storage/kv.ts b/apps/monograph/app/utils/storage/kv.ts
index a884c77db..099c86f71 100644
--- a/apps/monograph/app/utils/storage/kv.ts
+++ b/apps/monograph/app/utils/storage/kv.ts
@@ -39,7 +39,7 @@ export async function read<T>(key: string, fallback: T): Promise<T> {
const response = await WorkersKV.readKey({
key
});
- return JSON.parse(response.result) || fallback;
+ return response ? JSON.parse(response.result) || fallback : fallback;
} catch (e) {
console.error(e);
return fallback;