Update textParser for Date objects to simplify the code
slightly. In addition, use a "Date" constructor that is more
consistent across different versions of JavaScript.