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)
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.rbcast_fmtmethod usesDate.strptimewith flags from theiso8601method, butDate.strptimedoes not support flags, butdate_object.strftimedoes.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)