Project

General

Profile

Actions

Misc #15418

open

Date.parse('2018')

Added by foonlyboy (Eike Dierks) over 5 years ago. Updated over 5 years ago.

Status:
Open
Assignee:
-
[ruby-core:90552]

Description

Date.parse('2018')
ArgumentError: invalid date

I did expect that to return the same as:
Date.parse('2018-1-1')
=> Mon, 01 Jan 2018

working with dates and times is really weird and complicated,
so it makes sense to be strict with parsing.

I watched this one:
https://www.youtube.com/watch?v=-5wpm-gesOY
He's really coming up with some some crazy test cases.

In ruby this is split between Time and DateTime,
some in the core, some in in the standard lib.


Im looking forward for the new version,
let's freeze the strings!

~eike

Actions

Also available in: Atom PDF

Like0
Like0