Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontmatter date parsing oddities #78

Open
williamwgant opened this issue May 15, 2021 · 3 comments
Open

Frontmatter date parsing oddities #78

williamwgant opened this issue May 15, 2021 · 3 comments

Comments

@williamwgant
Copy link

Greetings,
I have a markdown file that has a date frontmatter field that expects the date in YYYY-MM-DD format. When I read the data out using front-matter (for instance, using the date '2021-04-01'), I get the date with a bunch of other crap in there. It seems to be actually parsing the date and adjusting for timezone, so in the previous instance I get 'Wed Mar 31 2021 19:00:00 GMT-0500 (Central Daylight Time)'. Is there a way to tell it not to try and infer the type without changing the format (which I can't do without breaking a lot of other stuff)? I really just need the raw text value.

@Toxaris
Copy link

Toxaris commented Nov 28, 2021

Same happened to me. I investigated and the problem appears to be that front-matter uses js-yaml with the default DEFAULT_SCHEMA which includes automatic detection of dates. It would be better to use CORE_SCHEMA or to pass through a schema option to js-yaml.

@mjgs
Copy link

mjgs commented May 3, 2023

I’m having the same issue.

Is there a way to set the js-yaml CORE_SCHEMA?

@mjgs
Copy link

mjgs commented May 6, 2023

I opened a related issue on the js-yaml repo , posting here in case it’s useful to others that run into something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants