v0.0.1
This commit is contained in:
9
web/lib/components/formattedDate.js
Normal file
9
web/lib/components/formattedDate.js
Normal file
@@ -0,0 +1,9 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user