Skip to content

Commit

Permalink
Added yyyy-mm-ddThh:nn format
Browse files Browse the repository at this point in the history
# Conflicts:
#	spec/timeliness/format_set_spec.rb
  • Loading branch information
espen committed Sep 20, 2024
1 parent 66a31e2 commit 0069f1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/timeliness/definitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module Definitions
'ddd, dd mmm yyyy hh:nn:ss tz', # RFC 822
'ddd, dd mmm yyyy hh:nn:ss zo', # RFC 822
'ddd mmm d hh:nn:ss zo yyyy', # Ruby time string
'yyyy-mm-ddThh:nn', # ISO 8601 without seconds
'yyyy-mm-ddThh:nn:ss', # ISO 8601
'yyyy-mm-ddThh:nn:sszo', # ISO 8601 with zone offset
'yyyy-mm-ddThh:nn:sszt', # ISO 8601 with 'Zulu time' (i.e. Z) UTC zone designator
Expand Down
2 changes: 2 additions & 0 deletions spec/timeliness/format_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
'yyyy-mm-ddThh:nn:sszo' => {pass: ['2008-07-19T12:00:00+10:00'], fail: ['2008-07-19T12:00:00Z+10:00']},
'yyyy-mm-ddThh:nn:ss.uzt' => {pass: ['2019-06-07T03:35:55.100000Z'], fail: []},
'dd.mm.yyyy hh:nn' => {pass: ['07.06.2019 03:35'], fail: []},
'yyyy-mm-dd hh:nn' => {pass: ['2019-06-07 03:35'], fail: []},
'yyyy-mm-ddThh:nn' => {pass: ['2019-06-07T03:35'], fail: []},
}
format_tests.each do |format, values|
it "should correctly match datetimes in format '#{format}'" do
Expand Down

0 comments on commit 0069f1d

Please sign in to comment.