diff --git a/public/react/src/common/DateUtil.js b/public/react/src/common/DateUtil.js index dc2288ff3..4bc481b10 100644 --- a/public/react/src/common/DateUtil.js +++ b/public/react/src/common/DateUtil.js @@ -38,6 +38,36 @@ export function getNextHalfHourOfMoment(moment) { return moment } + export function formatSeconds(value) { + + var theTime = parseInt(value);// 秒 + var middle= 0;// 分 + var hour= 0;// 小时 + + if(theTime > 60) { + middle= parseInt(theTime/60); + theTime = parseInt(theTime%60); + if(middle> 60) { + hour= parseInt(middle/60); + middle= parseInt(middle%60); + } + } + var result = ""+parseInt(theTime)+"秒"; + if(middle > 0) { + if(hour>0){ + result = ""+parseInt(middle)+"分"; + }else{ + result = ""+parseInt(middle)+"分"+result; + } + + } + if(hour> 0) { + result = ""+parseInt(hour)+"小时"+result; + } + return result; + } + + export function formatDuring(mss){ var days = parseInt(mss / (1000 * 60 * 60 * 24)); var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 2cb074a6a..c990b5dea 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -20,7 +20,7 @@ export { bytesToSize as bytesToSize } from './UnitUtil'; export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension, downloadFile, sortDirections } from './TextUtil' -export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' +export { handleDateString, getNextHalfHourOfMoment,formatDuring,formatSeconds} from './DateUtil' export { configShareForIndex, configShareForPaths, configShareForShixuns, configShareForCourses, configShareForCustom } from './util/ShareUtil' diff --git a/public/react/src/modules/courses/Video/Video.js b/public/react/src/modules/courses/Video/Video.js index 1ad16d702..181c082ae 100644 --- a/public/react/src/modules/courses/Video/Video.js +++ b/public/react/src/modules/courses/Video/Video.js @@ -243,7 +243,7 @@ class Video extends Component {
共 {videoData && videoData.count} 个视频
-播放数据从2020-03-13 24:00开始统计
+播放数据从2020-03-13 24:00开始统计