signoz/frontend/src/lib/getFormatedDate.ts
palash-signoz f1f606844a
chore: Eslint fix config (#882)
* chore: eslint config is updated

* chore: eslint auto fix is added
2022-03-22 12:10:31 +05:30

14 lines
331 B
TypeScript

function getFormattedDate(date: Date): string {
const year = date.getFullYear();
let month = (1 + date.getMonth()).toString();
month = month.length > 1 ? month : `0${month}`;
let day = date.getDate().toString();
day = day.length > 1 ? day : `0${day}`;
return `${month}/${day}/${year}`;
}
export default getFormattedDate;