cowtech-extensions 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -48,7 +48,7 @@ module Cowtech
|
|
48
48
|
day = 18
|
49
49
|
end
|
50
50
|
# End
|
51
|
-
|
51
|
+
|
52
52
|
Date.civil(year, month, day)
|
53
53
|
end
|
54
54
|
|
@@ -72,9 +72,20 @@ module Cowtech
|
|
72
72
|
}
|
73
73
|
end
|
74
74
|
|
75
|
-
def custom_format(key
|
76
|
-
key
|
77
|
-
|
75
|
+
def custom_format(key)
|
76
|
+
self.custom_formats.fetch(key.to_sym, key)
|
77
|
+
end
|
78
|
+
|
79
|
+
def is_valid?(value, format = "%F %T")
|
80
|
+
rv = true
|
81
|
+
|
82
|
+
begin
|
83
|
+
DateTime.strptime(value, format)
|
84
|
+
rescue
|
85
|
+
rv = false
|
86
|
+
end
|
87
|
+
|
88
|
+
rv
|
78
89
|
end
|
79
90
|
end
|
80
91
|
|
@@ -114,7 +125,7 @@ module Cowtech
|
|
114
125
|
mrv
|
115
126
|
end
|
116
127
|
|
117
|
-
self.
|
128
|
+
self.to_formatted_s(localized_format)
|
118
129
|
end
|
119
130
|
|
120
131
|
def to_localized_s(format = nil)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cowtech-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 1.6.
|
9
|
+
- 1
|
10
|
+
version: 1.6.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Shogun
|