This commit is contained in:
0x8664b2
2025-07-02 09:33:52 -07:00
parent 028dea3cb8
commit e28f2e0c51
17 changed files with 372 additions and 6 deletions

View File

@@ -1,12 +1,16 @@
class Event
attr_reader :begin_at, :end_at
attr_accessor :begin_at, :end_at, :name, :color
def initialize
@begin_at = DateTime.now.beginning_of_day
@end_at = DateTime.now + 1.day
def initialize(begin_at = DateTime.now.beginning_of_day, end_at = DateTime.now.end_of_day)
@begin_at = begin_at
@end_at = end_at
end
def during?(d)
self.begin_at <= d && d <= self.end_at
end
def first_day?(d)
self.begin_at.beginning_of_day <= d && d <= self.begin_at.end_of_day
end
end