/// Formats the event start date/time, and end date/time if it is different,
/// assuming that the start year and month is already known.
Formats the event start date/time, and end date/time if it is different,
assuming that the start year and month is already known.
Formats the event start date / time and end date / time if it is different assuming that the start year and month is already known .
pub fn short_time(&self) -> String {
        match self.time {
            EventTime::DateOnly {
                start_date,
                end_date,
            } => {
                if !self.multiday() {
                    start_date.format("%a %e").to_string()
                } else if start_date.month() == end_date.month() {
                    format!(
                        "{}–{}",
                        start_date.format("%a %e"),
                        end_date.format("%a %e")
                    )
                } else {
                    format!(
                        "{}–{}",
                        start_date.format("%a %e"),
                        end_date.format("%a %e %B")
                    )
                }
            }
            EventTime::DateTime { start, end } => {
                if !self.multiday() {
                    format!(
                        "{}–{}",
                        start.format("%a %e %l:%M %P"),
                        end.format("%l:%M %P")
                    )
                } else if start.month() == end.month() {
                    format!(
                        "{}–{}",
                        start.format("%a %e %l:%M %P"),
                        end.format("%a %e %l:%M %P")
                    )
                } else {
                    format!(
                        "{}–{}",
                        start.format("%a %e %l:%M %P"),
                        end.format("%a %e %B %l:%M %P")
                    )
                }
            }
        }
    }
pub fn short_time ( & self ) -> String { match self . time { EventTime :: DateOnly { start_date , end_date , } => { if ! self . multiday ( ) { start_date . format ( " " ) . to_string ( ) } else if start_date . month ( ) == end_date . month ( ) { format ! ( " start_date format ( " " ) end_date format ( " " ) ) } else { format ! ( " start_date format ( " " ) end_date format ( " " ) ) } } EventTime :: DateTime { start , end } => { if ! self . multiday ( ) { format ! ( " start format ( " " ) end format ( " " ) ) } else if start . month ( ) == end . month ( ) { format ! ( " start format ( " " ) end format ( " " ) ) } else { format ! ( " start format ( " " ) end format ( " " ) ) } } } }
Formats the event start date/time, and end date/time if it is different,
assuming that the start year and month is already known.
Formats the event start date / time and end date / time if it is different assuming that the start year and month is already known .
&self