TypeScript

by Yuriy Bablyukh

HTML

<div id="app"></div>

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#app {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  transition: all 0.2s;
  text-align: center;
}

TypeScript

convertNumberParameterToDate(val: string) {
    const s = val.substring(0, 4) + '-' + val.substring(0, 2);
    const dd =  new Date(s);
    return dd;
  }
const s = convertNumberParameterToDate('20240505123228979000');

console.log(s);