Sha256: 42309d2797532c79f6b74124c0b7f4dfc0e932df24a663226cd560c27e058555
Contents?: true
Size: 674 Bytes
Versions: 1
Compression:
Stored size: 674 Bytes
Contents
require "timetwister/version" require "timetwister/parser" module Timetwister def self.parse(str, options={}) out = [] str.split(';').each do |semi| semi.split(' and ').each do |conj| # check for dates of form "Month Day(-Day), Year" before splitting on commas # (removes certainty markers as to not jam the regex) if conj.gsub(/[\?\[\]]/, '').match(/[JFMASOND][A-Za-z]*\.?\s[0-9]{1,2}(\s?-[0-9]{1,2})?\,\s[0-9]{4}/) out << Parser.string_to_dates(conj, options) else conj.split(',').each do |comma| out << Parser.string_to_dates(comma, options) end end end end return out end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
timetwister-0.1.0 | lib/timetwister.rb |