Files
Sheep-Service/web/lib/components/formattedDate.js
2025-03-31 00:22:21 +03:00

9 lines
435 B
JavaScript

let formattedDate = (unix_timestamp) => {
if(!unix_timestamp) return
let date = new Date(unix_timestamp);
let year = date.getFullYear() >= 10 ? date.getFullYear() : "0" + date.getFullYear();
let month = (date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : "0" + (date.getMonth() + 1);
let weekday = date.getDate() >= 10 ? date.getDate() : "0" + date.getDate();
return weekday + '.' + month + '.' + year;
}