emailvision 2.1.18 → 2.1.19
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/emailvision/tools.rb +14 -10
- metadata +1 -1
data/lib/emailvision/tools.rb
CHANGED
@@ -2,11 +2,19 @@ module Emailvision
|
|
2
2
|
class Tools
|
3
3
|
|
4
4
|
def self.sanitize_parameters(parameters)
|
5
|
-
r_each(parameters) do |value|
|
5
|
+
r_each(parameters) do |value|
|
6
6
|
if value.respond_to?(:to_datetime)
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
begin
|
8
|
+
date_time_format(value.to_datetime)
|
9
|
+
rescue StandardError
|
10
|
+
value
|
11
|
+
end
|
12
|
+
elsif value.respond_to?(:to_date)
|
13
|
+
begin
|
14
|
+
date_time_format(value.to_date)
|
15
|
+
rescue StandardError
|
16
|
+
value
|
17
|
+
end
|
10
18
|
else
|
11
19
|
value
|
12
20
|
end
|
@@ -14,15 +22,11 @@ module Emailvision
|
|
14
22
|
end
|
15
23
|
|
16
24
|
def self.date_time_format(datetime)
|
17
|
-
datetime.strftime("%Y-%m-%dT%H:%M:%S")
|
18
|
-
rescue ArgumentError
|
19
|
-
datetime
|
25
|
+
datetime.strftime("%Y-%m-%dT%H:%M:%S")
|
20
26
|
end
|
21
27
|
|
22
28
|
def self.date_format(date)
|
23
|
-
date.strftime('%d/%m/%Y')
|
24
|
-
rescue ArgumentError
|
25
|
-
date
|
29
|
+
date.strftime('%d/%m/%Y')
|
26
30
|
end
|
27
31
|
|
28
32
|
def self.r_camelize(obj)
|