Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- formatTime: function(aDownloads) {
- aDownloads.forEach(download => {
- download.UnloadBeginTim = formatter.formatTime(download.UnloadBeginTim.ms);
- download.UnloadEndTim = formatter.formatTime(download.UnloadEndTim.ms);
- const formatDateTime = (date, time) => {
- const dateTimeDesc = new Date(
- date.getUTCFullYear(),
- date.getUTCMonth(),
- date.getUTCDate(),
- parseInt(time.split(':')[0]),
- parseInt(time.split(':')[1]),
- parseInt(time.split(':')[2])
- );
- const day = dateTimeDesc.getDate();
- const month = dateTimeDesc.getMonth() + 1;
- const year = dateTimeDesc.getFullYear();
- const hours = dateTimeDesc.getHours();
- const minutes = dateTimeDesc.getMinutes();
- const seconds = dateTimeDesc.getSeconds();
- return `${day.toString().padStart(2, "0")}-${month.toString().padStart(2, "0")}-${year.toString()} - ${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
- };
- download.UnloadBeginDat = formatDateTime(download.UnloadBeginDat, download.UnloadBeginTim);
- download.UnloadEndDat = formatDateTime(download.UnloadEndDat, download.UnloadEndTim);
- });
- return aDownloads;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement