date format

This commit is contained in:
Ivan Kirilov Dimitrov 2024-07-24 21:22:17 +02:00
parent 93ba2a60f0
commit 9a60cb5ee7
No known key found for this signature in database
GPG Key ID: 0BDAD4B211C49294
2 changed files with 24 additions and 0 deletions

11
_content/cases/otc-irs.md Normal file
View File

@ -0,0 +1,11 @@
---
title: EUREX OTC IRS in C7 CAS
goal: Integrate Over The Counter Interest Rate Swap including Calypso interface into C7 CAS
role: Software developer helping with the integration
date: Feb 2024 - Jun 2024
z: 9
draft: true
---

View File

@ -14,6 +14,19 @@ export const getContent = (slug: string[]): GrayMatterFile<string> => {
if (!contentMap[p]) {
const file = fs.readFileSync(p, "utf8");
const m = matter(file);
const date = m.data.date;
if (date) {
m.data.date = "";
const d = date.split("-");
const from = d[0]?.trim();
const to = d[1]?.trim();
if (from) {
m.data.date += new Date(from).toDateString()
}
if (to) {
m.data.date += ` - ${new Date(to).toDateString()}`
}
}
m.data.slug = `/c/${slug.join("/")}`;
contentMap[p] = m;
return m;