Fix rubocop warnings
This commit is contained in:
parent
2239554e60
commit
b33fd6dd37
1 changed files with 2 additions and 2 deletions
|
@ -153,9 +153,9 @@ class Champ < ActiveRecord::Base
|
|||
nil
|
||||
end
|
||||
self.value = date
|
||||
elsif /^\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}$/ =~ value # old browsers can send with dd/mm/yyyy hh:mm format
|
||||
elsif /^\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}$/.match?(value) # old browsers can send with dd/mm/yyyy hh:mm format
|
||||
self.value = DateTime.parse(value, "%d/%m/%Y %H:%M").strftime("%Y-%m-%d %H:%M")
|
||||
elsif !(/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/ =~ value) # a datetime not correctly formatted should not be stored
|
||||
elsif !(/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.match?(value)) # a datetime not correctly formatted should not be stored
|
||||
self.value = nil
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue