Skip to content

Commit

Permalink
Changes the way the date is displayed in image-manager.
Browse files Browse the repository at this point in the history
Signed-off-by: Abijeet <[email protected]>
  • Loading branch information
Abijeet committed Jun 30, 2018
1 parent 448068e commit f5df5ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions resources/assets/js/services/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ export function utcTimeStampToLocalTime(timestamp) {
let hours = date.getHours();
let mins = date.getMinutes();
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}`;
}
5 changes: 4 additions & 1 deletion resources/assets/js/vues/image-manager.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

import * as Dates from "../services/dates";

const dropzone = require('./components/dropzone');

let page = 0;
Expand Down Expand Up @@ -168,7 +171,7 @@ const methods = {
},

getDate(stringDate) {
return new Date(stringDate);
return Dates.formatDateTime(new Date(stringDate));
},

uploadSuccess(event) {
Expand Down

0 comments on commit f5df5ac

Please sign in to comment.