|
@@ -20,25 +20,31 @@ const gradeUpper = grade => {
|
|
return gradeArr[grade];
|
|
return gradeArr[grade];
|
|
}
|
|
}
|
|
|
|
|
|
-//时间转换秒转天或小时或分
|
|
|
|
|
|
+//将秒转化为 X/XX 比如四小时三十六分 为4/36
|
|
const day = msd => {
|
|
const day = msd => {
|
|
- let time = Math.floor(msd) + "秒";
|
|
|
|
- if( Math.floor(msd )> 60){
|
|
|
|
- let min = Math.floor(msd / 60);
|
|
|
|
- time = min + "分";
|
|
|
|
- if( min > 60 ){
|
|
|
|
- min = Math.floor(msd / 60) % 60;
|
|
|
|
- let hour = Math.floor( msd / 3600 );
|
|
|
|
- // time = hour + "小时" + min + "分";
|
|
|
|
- time = hour + "时";
|
|
|
|
- if( hour > 24 ){
|
|
|
|
- hour = Math.floor( msd / 3600 ) % 24;
|
|
|
|
- let day = Math.floor(msd / 3600 / 24);
|
|
|
|
- // time = day + "天" + hour + "小时";
|
|
|
|
- time = day + "天";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //不到一分钟的情况;
|
|
|
|
+ let time = Math.floor(msd);//整数秒
|
|
|
|
+ time = "0/00";
|
|
|
|
+ //超过一分钟的情况
|
|
|
|
+ if( Math.floor(msd )> 60){
|
|
|
|
+ let min = Math.floor(msd / 60);
|
|
|
|
+ let hour = Math.floor(min / 60);
|
|
|
|
+ let minShow = min % 60;
|
|
|
|
+ time = hour + "/" + minShow ;
|
|
|
|
+ // if( min > 60 ){
|
|
|
|
+ // min = Math.floor(msd / 60) % 60;
|
|
|
|
+ // let hour = Math.floor( msd / 3600 );
|
|
|
|
+ // // time = hour + "小时" + min + "分";
|
|
|
|
+ // time = hour + "时";
|
|
|
|
+ // if( hour > 24 ){
|
|
|
|
+ // hour = Math.floor( msd / 3600 ) % 24;
|
|
|
|
+ // let day = Math.floor(msd / 3600 / 24);
|
|
|
|
+ // // time = day + "天" + hour + "小时";
|
|
|
|
+ // time = day + "天";
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
+
|
|
return time;
|
|
return time;
|
|
}
|
|
}
|
|
|
|
|