anjlab-widgets 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/anjlab-widgets.rb +7 -7
- data/lib/anjlab-widgets/version.rb +1 -1
- metadata +3 -3
data/lib/anjlab-widgets.rb
CHANGED
@@ -26,7 +26,7 @@ module Anjlab
|
|
26
26
|
|
27
27
|
def self.parse_date date_string
|
28
28
|
begin
|
29
|
-
|
29
|
+
parse_date! date_string
|
30
30
|
rescue
|
31
31
|
nil
|
32
32
|
end
|
@@ -38,29 +38,29 @@ module Anjlab
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def self.parse_time! time_string
|
41
|
-
return nil if
|
41
|
+
return nil if time_string.blank?
|
42
42
|
now = Time.now
|
43
43
|
parts = time_string.split(':')
|
44
|
-
Time.local(now.year, now.month, day, parts[0], parts[1])
|
44
|
+
Time.local(now.year, now.month, now.day, parts[0].to_i, parts[1].to_i)
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.parse_time time_string
|
48
48
|
begin
|
49
|
-
self.parse_time!
|
49
|
+
self.parse_time! time_string
|
50
50
|
rescue
|
51
51
|
nil
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
55
|
def self.parse_datetime! date_string, time_string
|
56
|
-
date = parse_date date_string
|
57
|
-
time = parse_time time_string
|
56
|
+
date = parse_date! date_string
|
57
|
+
time = parse_time! time_string
|
58
58
|
Time.local(date.year, date.month, date.day, time.hour, time.min)
|
59
59
|
end
|
60
60
|
|
61
61
|
def self.parse_datetime date_string, time_string
|
62
62
|
begin
|
63
|
-
|
63
|
+
parse_datetime! date_string, time_string
|
64
64
|
rescue
|
65
65
|
nil
|
66
66
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anjlab-widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
segments:
|
167
167
|
- 0
|
168
|
-
hash:
|
168
|
+
hash: -3680143931269918093
|
169
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
170
|
none: false
|
171
171
|
requirements:
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
version: '0'
|
175
175
|
segments:
|
176
176
|
- 0
|
177
|
-
hash:
|
177
|
+
hash: -3680143931269918093
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project:
|
180
180
|
rubygems_version: 1.8.22
|