mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-23 06:16:44 +00:00
added core extension files for adding to_dummy_time to Date, Time and DateTime classes
This commit is contained in:
parent
ef68b3d0f9
commit
bac867cbbb
11
lib/validates_timeliness/core_ext/date.rb
Normal file
11
lib/validates_timeliness/core_ext/date.rb
Normal file
@ -0,0 +1,11 @@
|
||||
module ValidatesTimeliness
|
||||
module CoreExtensions
|
||||
module Date
|
||||
|
||||
def to_dummy_time
|
||||
Time.utc_time(2000, 1, 1, 0, 0, 0)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
11
lib/validates_timeliness/core_ext/date_time.rb
Normal file
11
lib/validates_timeliness/core_ext/date_time.rb
Normal file
@ -0,0 +1,11 @@
|
||||
module ValidatesTimeliness
|
||||
module CoreExtensions
|
||||
module DateTime
|
||||
|
||||
def to_dummy_time
|
||||
Time.utc_time(2000, 1, 1, hour, min, sec)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
11
lib/validates_timeliness/core_ext/time.rb
Normal file
11
lib/validates_timeliness/core_ext/time.rb
Normal file
@ -0,0 +1,11 @@
|
||||
module ValidatesTimeliness
|
||||
module CoreExtensions
|
||||
module Time
|
||||
|
||||
def to_dummy_time
|
||||
self.class.utc(2000, 1, 1, hour, min, sec)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user