helpers.rb
# Takes an item with start_date and end_date properties and returns
# a date string with month name.
Takes an item with start_date and end_date properties and returns
a date string with month name.
Takes an item with start_date and end_date properties and returns a date string with month name .
def dates(item)
    [item.start_date, item.end_date].each_with_index.map {|date, i|
        month = date && date.month ? Date::MONTHNAMES[date.month] : ""
        year = date && date.year ? date.year : ""
        item.is_current && i == 1 ? "Present" : "#{month} #{year}".strip
    }.reject {|date| date.size == 0}.join(" - ")
  end
def dates ( item ) [ item . start_date , item . end_date ] . each_with_index . map { | date , i | month = date && date . month ? Date :: MONTHNAMES [ date . month ] : "" year = date && date . year ? date . year : "" item . is_current && i == 1 ? "Present" : "#{month} #{year}" . strip } . reject { | date | date . size == 0 } . join ( " - " ) end
Takes an item with start_date and end_date properties and returns
a date string with month name.
Takes an item with start_date and end_date properties and returns a date string with month name .
item
<not_specific>