Skip to content

Use of Ruby Date.strptime(date_string, format) versus date_object.strftime(format) #42

@jrjamespdx

Description

@jrjamespdx

Overview

Date format validation is currently not working as expected and definitely not working for ISO8601 validation. The issue seems to be that the lib/tableschema/types/date.rb cast_fmt method uses Date.strptime with flags from the iso8601 method, but Date.strptime does not support flags, but date_object.strftime does.

Links to docs:
https://ruby-doc.org/stdlib-2.5.3/libdoc/date/rdoc/Date.html#method-c-strptime
https://ruby-doc.org/stdlib-2.5.3/libdoc/date/rdoc/Date.html#method-i-strftime

I'll submit a PR for a change shortly.


Please preserve this line to notify @roll (lead of this repository)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions