Sha256: 6d85901bb9e61c787e114a3bb8734b86a8a4033d32cb452b897753085eaaa76b
Contents?: true
Size: 733 Bytes
Versions: 7
Compression:
Stored size: 733 Bytes
Contents
module SoberSwag module Reporting module Input module Converting ## # Convert via a date. DateTime = SoberSwag::Reporting::Input::Text .new .mapped { |str| begin ::DateTime.rfc3339(str) rescue ArgumentError Report::Value.new(['was not an RFC 3339 date-time string']) end }.or( SoberSwag::Reporting::Input::Text .new .mapped do |str| ::DateTime.iso8601(str) rescue ArgumentError Report::Value.new(['was not an ISO8601 date-time string']) end ).format('date-time') end end end end
Version data entries
7 entries across 7 versions & 1 rubygems