This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can extend the parser by adding a new parsing function to the `XDate.parsers` array. | |
// This function is given a single string argument and should return an XDate if parsing was successful. | |
function parseMDY(str) { | |
// this example parses dates like "month/date/year" | |
var parts = str.split('/'); | |
if (parts.length == 3) { | |
return new XDate( | |
parseInt(parts[2]), // year | |
parseInt(parts[0] ? parts[0]-1 : 0), // month |