Fix date parsing in Ruby < 1.9