Module: IndeedUtilities
- Included in:
- IndeedAwards, IndeedCertifications, IndeedDegrees, IndeedGroups, IndeedJobs, IndeedLinks, IndeedMilitaryService, IndeedRecPeople
- Defined in:
- lib/indeed_utilities.rb
Instance Method Summary collapse
Instance Method Details
#date_normalize(date) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/indeed_utilities.rb', line 15 def date_normalize(date) begin date = date+"-01-01" if date =~ /^(19|20)\d{2}$/ return Date.parse(date) rescue return date end end |
#parse_dates(dates) ⇒ Object
Parse dates
5 6 7 8 9 10 11 12 13 |
# File 'lib/indeed_utilities.rb', line 5 def parse_dates(dates) start_date, end_date = dates if dates.include?(" to ") start_date, end_date = dates.split(" to ") end return date_normalize(start_date), date_normalize(end_date) end |