app/models/service_learning/service_learning_position_time.rb
def pretty_print
    days = []
    %w(monday tuesday wednesday thursday friday saturday sunday).each do |day|
      days << day.titleize if self.read_attribute(day)
    end
    days_join = days.empty? ? "All days" : days.join(', ')
    days_join = "Weekdays" if days_join == "Monday, Tuesday, Wednesday, Thursday, Friday"
    t = "#{days_join} from #{start_time.to_formatted_s(:time12)} to #{end_time.to_formatted_s(:time12)}"
    t << " (choose your shift within these hours)" if flexible?
    t
  rescue
    nil
  end
# Returns a textual representation of this time
Returns a textual representation of this time
Returns a textual representation of this time
def pretty_print
    days = []
    %w(monday tuesday wednesday thursday friday saturday sunday).each do |day|
      days << day.titleize if self.read_attribute(day)
    end
    days_join = days.empty? ? "All days" : days.join(', ')
    days_join = "Weekdays" if days_join == "Monday, Tuesday, Wednesday, Thursday, Friday"
    t = "#{days_join} from #{start_time.to_formatted_s(:time12)} to #{end_time.to_formatted_s(:time12)}"
    t << " (choose your shift within these hours)" if flexible?
    t
  rescue
    nil
  end
def pretty_print days = [ ] %w( monday tuesday wednesday thursday friday saturday sunday ) . each do | day | days << day . titleize if self . read_attribute ( day ) end days_join = days . empty? ? "All days" : days . join ( ', ' ) days_join = "Weekdays" if days_join == "Monday, Tuesday, Wednesday, Thursday, Friday" t = "#{days_join} from #{start_time.to_formatted_s(:time12)} to #{end_time.to_formatted_s(:time12)}" t << " (choose your shift within these hours)" if flexible? t rescue nil end
Returns a textual representation of this time
Returns a textual representation of this time