commit
072ad932eb
3 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@ version: 2
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
working_directory: ~/tps
|
working_directory: ~/tps
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/ruby:2.3.6-node-browsers
|
- image: circleci/ruby:2.5.0-node-browsers
|
||||||
- image: circleci/postgres:9.5
|
- image: circleci/postgres:9.5
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: tps_test
|
POSTGRES_USER: tps_test
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.3.6
|
2.5.0
|
||||||
|
|
|
@ -153,9 +153,9 @@ class Champ < ActiveRecord::Base
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
self.value = date
|
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")
|
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
|
self.value = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue