matthewmueller / matthewmueller/date

return null if can't parse a date

Open
#12 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.5k
Forks
85
PR merge metrics
No merged PRs in 30d

Description

by default, date appears to return the new Date() if it couldn't make sense of the input.
this isn't really ideal.
it's pretty easy to do

var d = date(string) || new Date()

Otherwise, there isn't an easy way to tell if it's a valid time or not.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the date(string) parsing behavior and how it handles inputs it cannot understand. Verify the current fallback and identify the existing tests for invalid dates; done means invalid input returns null while valid date parsing continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.