Sha256: 7ffe32ac80092e53af3b2acfdafe3ed5de98e96df7d4e9119f81ec5f9f950b40
Contents?: true
Size: 944 Bytes
Versions: 88
Compression:
Stored size: 944 Bytes
Contents
# encoding: utf-8 class Date def self.year(year=Date.today.year) Date.new(year) end def january(day=nil) day.nil?? self.change(month: 1) : self.change(month: 1, day: day) end def october(day=nil) day.nil?? self.change(month: 10) : self.change(month: 10, day: day) end def december(day=nil) day.nil?? self.change(month: 12) : self.change(month: 12, day: day) end def monday self - (self.wday - 1) % 7 end def weekend? self.wday == 0 || self.wday == 6 end def display "#{Configuration::DAYS[self.wday]} #{self.day} de #{Configuration::MONTHS[self.month-1]} #{self.year == Date.today.year ? '' : self.year}" end def short_display self.strftime('%d/%m/%Y') end def next_working_date add_working_days(1) end def prev_working_date add_working_days(-1) end def first_monday_before return self if self.monday? (self - 1).first_monday_before end end
Version data entries
88 entries across 88 versions & 1 rubygems