lib/cinch/plugins/schedule.rb
def command_schedule(m, command)
        upcoming_events = @calendar.upcoming_events

        if command == "refresh"
          refresh_calendar
        elsif upcoming_events.length > 0
          m.user.send "#{upcoming_events.length} upcoming show#{upcoming_events.length > 1 ? "s" : ""}"
          upcoming_events.sort{|e1, e2| e1.start_time <=> e2.start_time}.each do |event|
            tz = TZInfo::Timezone.get('America/New_York')
            time = tz.utc_to_local(event.start_time)
            date_string = time.strftime("%A, %-m/%-d/%Y")
            time_string = time.strftime("%-I:%M%P EST")
            m.user.send "  #{event.summary} on #{date_string} at #{time_string}"
          end
        end

      end
# Replies with the schedule for the next 7 days of shows
Replies with the schedule for the next 7 days of shows
Replies with the schedule for the next 7 days of shows
def command_schedule(m, command)
        upcoming_events = @calendar.upcoming_events
        if command == "refresh"
          refresh_calendar
        elsif upcoming_events.length > 0
          m.user.send "#{upcoming_events.length} upcoming show#{upcoming_events.length > 1 ? "s" : ""}"
          upcoming_events.sort{|e1, e2| e1.start_time <=> e2.start_time}.each do |event|
            tz = TZInfo::Timezone.get('America/New_York')
            time = tz.utc_to_local(event.start_time)
            date_string = time.strftime("%A, %-m/%-d/%Y")
            time_string = time.strftime("%-I:%M%P EST")
            m.user.send "  #{event.summary} on #{date_string} at #{time_string}"
          end
        end
      end
def command_schedule ( m , command ) upcoming_events = @calendar . upcoming_events if command == "refresh" refresh_calendar elsif upcoming_events . length > 0 m . user . send "#{upcoming_events.length} upcoming show#{upcoming_events.length > 1 ? "s" : ""}" upcoming_events . sort { | e1 , e2 | e1 . start_time <=> e2 . start_time } . each do | event | tz = TZInfo :: Timezone . get ( 'America/New_York' ) time = tz . utc_to_local ( event . start_time ) date_string = time . strftime ( "%A, %-m/%-d/%Y" ) time_string = time . strftime ( "%-I:%M%P EST" ) m . user . send "  #{event.summary} on #{date_string} at #{time_string}" end end end
Replies with the schedule for the next 7 days of shows
Replies with the schedule for the next 7 days of shows
m
command