Changed date parsing logic to work with Safari 5.1.3 and below