struct TCal::Calendar::HTML::Event
- TCal::Calendar::HTML::Event
- Struct
- Value
- Object
Overview
Represents an event within a Week
.
If #starts_this_week
or #ends_this_week
are false, the event should be
shown as continuing from the previous week or into the next week. #period
only includes days within "this" week.
Defined in:
t_cal/calendar/html.crConstructors
Instance Method Summary
- #alert : V3API::Alert::Resource
- #clone
- #colors : Calendar::RouteColors | Nil
- #copy_with(alert _alert = @alert, colors _colors = @colors, period _period = @period, starts_this_week _starts_this_week = @starts_this_week, ends_this_week _ends_this_week = @ends_this_week)
- #description : String
- #details : String | Nil
-
#end_column : Int32
The 1-based grid column the event ends on.
- #ends_this_week : Bool
- #image_alt : String
- #image_url : String | Nil
- #period : DatePeriod
-
#sort_key
Provides a key for sorting events.
-
#start_column : Int32
The 1-based grid column the event starts on.
- #starts_this_week : Bool
- #title : String
- #url : String | Nil
Constructor Detail
def self.new(alert : V3API::Alert::Resource, colors : Calendar::RouteColors | Nil, period : DatePeriod, starts_this_week : Bool, ends_this_week : Bool)
#
Instance Method Detail
def copy_with(alert _alert = @alert, colors _colors = @colors, period _period = @period, starts_this_week _starts_this_week = @starts_this_week, ends_this_week _ends_this_week = @ends_this_week)
#
def end_column : Int32
#
The 1-based grid column the event ends on.
This is exclusive (the event occupies the columns from #start_column
up
to, but not including, this one). Because of this, it can have the value
8
despite the grid only being expected to contain 7 columns. This is in
line with the behavior of grid-column-end
in CSS.
def sort_key
#
Provides a key for sorting events.
Events are sorted earlier:
- when they continue from the previous week and into the next week
- then when they continue from the previous week
- then when they start in an earlier column
- then when they have no associated route colors
- then when their title is alphabetically earlier