Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

12 lines (11 sloc) 0.376 kb
class TypoTime
def self.delta(year = nil, month = nil, day = nil)
return nil if year.nil? && month.nil? && day.nil?
from = Time.utc(year, month || 1, day || 1)
to = from.next_year
to = from.next_month unless month.blank?
to = from + 1.day unless day.blank?
to = to - 1 # pull off 1 second so we don't overlap onto the next day
from..to
end
end
Jump to Line
Something went wrong with that request. Please try again.