Introduce monkey patch for date
Allows to retrieve the begin of month for a given date
This commit is contained in:
parent
2e3a68e285
commit
e0d300c441
8
lib/planet_express/date.rb
Normal file
8
lib/planet_express/date.rb
Normal file
@ -0,0 +1,8 @@
|
||||
require 'date'
|
||||
|
||||
# Nasty monkey patching to make date objects know about the beginning of a month
|
||||
class Date
|
||||
def begin_of_month
|
||||
Date.new(year, month, 1)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user