Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added yyyy-mm-ddThh:nn format #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading