(data)
| 369 | |
| 370 | // offer something that can figure out the right date class to return |
| 371 | export function makeDate(data) { |
| 372 | var date = new TLDate(data); |
| 373 | if (!isNaN(date.getTime())) { |
| 374 | return date; |
| 375 | } |
| 376 | return new BigDate(data); |
| 377 | } |
| 378 | |
| 379 | export function parseDate(str) { |
| 380 | if (str.match(ISO8601_SHORT_PATTERN)) { |