colouring-montreal/app/src/helpers.ts

7 lines
199 B
TypeScript
Raw Normal View History

2019-08-30 08:45:55 -04:00
export function dateReviver(name, value) {
if (typeof value === "string" && /^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d.\d\d\dZ$/.test(value)) {
return new Date(value);
}
return value;
}