diff --git a/assets/js/list.index.js b/assets/js/list.index.js index ef75134..1cae6a3 100644 --- a/assets/js/list.index.js +++ b/assets/js/list.index.js @@ -4,6 +4,14 @@ import {getData, getDataObj} from "./base.js"; import {_serverUrl} from "./setting.js"; export var connection; +export function dateTimeFormat(dateTime) { + var date = moment.utc(dateTime).local(); + var difmonths = moment().diff(date, "months"); + if (difmonths == 0) { + return moment(dateTime).fromNow(); + } + return date.format("DD MMM, YYYY HH:mm"); +} function createLoad(data) { let html = ""; if (data.length != 0) { @@ -157,24 +165,46 @@ function loadData() { // Notifcations let bdyUI = '