Skip to content

date parsing is clunky and inflexible #4

@chesles

Description

@chesles

Right now any dates given to the --at, --start, --end, --before, or --after options have to be a string that new Date(str) can understand. That means things like "15 minutes ago" or "in 2 hours" won't work.

After surveying the landscape of javascript date parsers, (datejs, moment, etc), none seem to provide everything I want. Right now I am planning to use chrono-node to handle things like "last friday at noon", and a custom parser built using https://github.com/harthur/classifier for things like "5 minutes ago".

Training sets to classify past/future ("in", "ago", "from", etc) and units ("minutes", "min", "m", "hours", etc) should be pretty effective. Not quite sure how to extract the number though, unless I just require it to always be in decimal form ("5" rather than "five"), which I don't think is an unreasonable requirement.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions