Skip to content

[metascrapper-date] 2001 is default year for Date('Jun 20') #241

Closed
@slavaGanzin

Description

@slavaGanzin
Contributor

Prerequisites

  • I'm using the last version.
    My node version is the same as declared as package.json.

Subject of the issue

When date is presented omitting year, for example Jun 20. Chrome/NodeJS new Date will not produce NaN as it should and will output 2001-06-11T21:00:00.000Z which is total mess.
while chrono parse it right:

> chrono.parseDate('Jun 12'); 
2019-06-12T09:00:00.000Z

You can find date in this format here:
https://vicki.substack.com/p/keybase-and-the-chaos-of-crypto

Proposition

completely remove native parsing and use crono as reliable parser:
https://github.com/microlinkhq/metascraper/blob/master/packages/metascraper-helpers/index.js#L201-L202

p.s. I don't know why Date / chrono add 21 and 9 hours to date respectivly, but I think it's negligible if date has no year.

Activity

added 6 commits that reference this issue on Dec 10, 2019
250e058
ca23b7d
1418093
7ff7e2b
2abb597
c80ed58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @slavaGanzin

        Issue actions

          [metascrapper-date] 2001 is default year for Date('Jun 20') · Issue #241 · microlinkhq/metascraper