Render yearly view

This commit is contained in:
0x8664b2
2022-08-23 14:51:20 -07:00
parent 86303fd320
commit 028dea3cb8
9 changed files with 59 additions and 9 deletions

12
app/models/event.rb Normal file
View File

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