Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/holiday_scraper/parser.rb

Overview

-*- coding: utf-8 -*-

Purpose: Extend the date parsing capabilities of Ruby to work with dates with international month names.

Usage:

Date.parse_international(date_string) DateTime.parse_international(date_string) date_string.to_international_date

Notes: 1) This routine works by substituting your local month names (as defined by Date::MONTHNAMES) for the

international names when they occur in the date_string.

2) As distributed, this code works for French, German, Italian, and Spanish. You must add the month

names for any additional languages you wish to handle.

Class Method Summary collapse

Class Method Details

.parse_international(string) ⇒ Object



86
87
88
# File 'lib/holiday_scraper/parser.rb', line 86

def self.parse_international(string)
  parse(month_to_english(string))
end