Class: HammerCLI::Options::Normalizers::DateTime
Class Method Summary
collapse
Instance Method Summary
collapse
#complete, #completion_type, #description, inherited
Class Method Details
.common_description ⇒ Object
361
362
363
|
# File 'lib/hammer_cli/options/normalizers.rb', line 361
def common_description
_('Date and time in YYYY-MM-DD HH:MM:SS or ISO 8601 format')
end
|
.completion_type ⇒ Object
357
358
359
|
# File 'lib/hammer_cli/options/normalizers.rb', line 357
def completion_type
:datetime
end
|
Instance Method Details
366
367
368
369
370
371
|
# File 'lib/hammer_cli/options/normalizers.rb', line 366
def format(date)
raise ArgumentError unless date
::Time.parse(date).iso8601
rescue ArgumentError
raise ArgumentError, _("'%s' is not a valid date.") % date
end
|