Changes the way the date is displayed in image-manager.

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
This commit is contained in:
Abijeet 2018-06-30 10:28:11 +05:30
parent 448068e318
commit f5df5ac7d5
2 changed files with 13 additions and 1 deletions

View file

@ -13,3 +13,12 @@ export function utcTimeStampToLocalTime(timestamp) {
let mins = date.getMinutes(); let mins = date.getMinutes();
return `${(hours>9?'':'0') + hours}:${(mins>9?'':'0') + mins}`; return `${(hours>9?'':'0') + hours}:${(mins>9?'':'0') + mins}`;
} }
export function formatDateTime(date) {
let month = date.getMonth() + 1;
let day = date.getDate();
let hours = date.getHours();
let mins = date.getMinutes();
return `${date.getFullYear()}-${(month>9?'':'0') + month}-${(day>9?'':'0') + day} ${(hours>9?'':'0') + hours}:${(mins>9?'':'0') + mins}`;
}

View file

@ -1,3 +1,6 @@
import * as Dates from "../services/dates";
const dropzone = require('./components/dropzone'); const dropzone = require('./components/dropzone');
let page = 0; let page = 0;
@ -168,7 +171,7 @@ const methods = {
}, },
getDate(stringDate) { getDate(stringDate) {
return new Date(stringDate); return Dates.formatDateTime(new Date(stringDate));
}, },
uploadSuccess(event) { uploadSuccess(event) {