Skip to content
This repository was archived by the owner on Aug 28, 2021. It is now read-only.

Commit ae35b5b

Browse files
committed
change getVideoFileName return value
1 parent b2768d5 commit ae35b5b

1 file changed

Lines changed: 3 additions & 26 deletions

File tree

app/src/popup.js

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,9 @@ function canDownload({ lesson }) {
3838
return lesson.medias.some((media) => media.mediaType === "Video")
3939
}
4040

41-
/**
42-
* @description retruns the video filename in the following format Year/Month/Data - startTime - EndTime as it is easier to sort in order
43-
* @returns {string}
44-
*/
45-
function getVideoFileName({ lesson }) {
46-
const dateObj = new Date(lesson.startTimeUTC);
47-
const month = ("0" + (dateObj.getUTCMonth() + 1)).slice(-2)//months from 01-12
48-
const day = ("0" + dateObj.getUTCDate()).slice(-2);
49-
const year = dateObj.getUTCFullYear();
50-
51-
const startTimeDateObj = new Date(lesson.lesson.timing.start);
52-
const startTime = startTimeDateObj.toLocaleTimeString(navigator.language, {
53-
hour: '2-digit',
54-
minute: '2-digit'
55-
});
56-
57-
58-
const endTimeDateObj = new Date(lesson.lesson.timing.end);
59-
const endTime = endTimeDateObj.toLocaleTimeString(navigator.language, {
60-
hour: '2-digit',
61-
minute: '2-digit'
62-
});
63-
64-
const name = year + "-" + month + "-" + day + ' ' + startTime + '-' + endTime;
65-
66-
return name.replaceAll(':', '\ua789');
41+
function getVideoFileName({lesson}) {
42+
const {updatedAt} = lesson.lesson;
43+
return updatedAt.slice(0, updatedAt.indexOf("T"));
6744
}
6845

6946
/**

0 commit comments

Comments
 (0)