function formatDate()

in lib/util.js [241:260]


function formatDate(exp, name = '') {
  if (exp && !(exp instanceof Date)) {
    if (typeof exp === 'number' && exp < 946728000000) exp *= 1000;
    exp = new Date(exp);
    if (/invalid date/i.test(exp.toString())) {
      exp = Number(exp);
      if (isNaN(exp)) {
        exp = null;
        console.error(`Date of cookie ${name} is invalid`);
      } else {
        if (exp < 946728000000) exp *= 1000;
        exp = new Date(exp);
        if (/invalid date/i.test(exp.toString())) {
          console.error(`Date of cookie ${name} is invalid`);
        }
      }
    }
  }
  return exp;
}