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

Some timestamps are not parsed as such #700

Open
Giszmo opened this issue Apr 3, 2023 · 0 comments
Open

Some timestamps are not parsed as such #700

Giszmo opened this issue Apr 3, 2023 · 0 comments

Comments

@Giszmo
Copy link

Giszmo commented Apr 3, 2023

I store timestamps as just dates as such:

const schema = yaml.DEFAULT_SCHEMA
schema.compiledTypeMap.scalar['tag:yaml.org,2002:timestamp'].represent = function (it) {
  return dateFormat(it, 'yyyy-mm-dd')
}
...
yaml.dump(header, {
  schema: schema
})

but somehow some values get handled right and others not.

The json contains:

released: '2021-08-26T07:00:00Z',
updated: '2023-03-25T12:43:55Z',

and my drop-the-hour logic handles the second value just fine but the first value not:

released: '2021-08-26T07:00:00Z'
updated: 2023-03-25

What might be wrong here?

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

1 participant