const convert = {
toISO: (text) => {
if (text) {
const parts = text.match(/(\d+)/g);
return ("00" + parts).slice(-2) +
"-" + ("00" + parts).slice(-2) +
"-" + ("0000" + parts).slice(-4);
}
},
fromISO: (iso) => {
if (iso)
return iso.substring(8, 10) + "." + iso.substring(5, 7) + "." + iso.substring(0, 4);
}
};