. chronic.parse . strftime , .
puts Chronic.parse('today').strftime('%d %b %Y')
, - , . - , , .
: Chronic pre_normalize, .
""
puts Chronic.parse('12-02-2010').strftime('%d %b %Y')
module Chronic
class << self
alias chronic__pre_normalize pre_normalize
def pre_normalize(text)
text = text.split(/[^\d]/).reverse.join("-") if text =~ /^\d{1,2}[^\d]\d{1,2}[^\d]\d{4}$/
text = chronic__pre_normalize(text)
return text
end
end
end
puts Chronic.parse('12-02-2010').strftime('%d %b %Y')