struct TCal::Calendar::HTML::Event

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(alert : V3API::Alert::Resource, colors : Calendar::RouteColors | Nil, period : DatePeriod, starts_this_week : Bool, ends_this_week : Bool) #

[View source]

Instance Method Detail


def clone #

[View source]
def colors : Calendar::RouteColors | Nil #

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) #

[View source]
def description : String #

[View source]
def details : String | Nil #

[View source]
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.


[View source]
def ends_this_week : Bool #

def image_alt : String #

[View source]
def image_url : String | Nil #

[View source]
def period : DatePeriod #

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

[View source]
def start_column : Int32 #

The 1-based grid column the event starts on.


[View source]
def starts_this_week : Bool #

def title : String #

[View source]
def url : String | Nil #

[View source]