deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

YAML: Allow to store dates without time

Open oscarotero opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

I want to create a front matter with a code like this:

---
title: Post title
date: 2024-09-01
---

But YAML export the date value in this way:

---
title: Post title
date: 2024-09-01T19:00:00Z
---

The only way I found to save only the date (without time) was to convert the value to a string:

---
title: Post title
date: "2024-09-01"
---

But then this value is not parsed as Date.

Describe the solution you'd like

A way to store dates without including the time. As an idea, maybe detecting if the object is a Temporal.PlainDate instance.

oscarotero avatar Aug 14 '24 11:08 oscarotero