123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- function substrDate(str){
- return str.substring(0,10)
- }
- function substrText(str,start,end){
- return str.substring(start,end)
- }
- function numRate(value){
- var result=(value==''?'0%':(value*100).toFixed(0)+"%");
- return result
- }
- function indexOf(arr, value) {
- if (arr.indexOf(value) < 0) {
- return false;
- } else {
- return true;
- }
- }
- function learnTime(value){
- if(value==''){
- return '';
- }else{
- var hour=Math.floor(value/3600);
- var minute=Math.floor((value-hour*3600)/60);
- var second=value%60;
- // return hour+'小时'+minute+'分钟'+second+'秒';
- return hour+'小时'+minute+'分钟';
- }
-
- }
- function learnTimeHour(value){
- var hour=Math.floor(value/3600);
- var minute=Math.floor((value-hour*3600)/60);
- var second=value%60;
-
- return hour;
- }
- function learnTimeMinute(value){
- var hour=Math.floor(value/3600);
- var minute=Math.floor((value-hour*3600)/60);
- var second=value%60;
-
- return minute;
- }
- module.exports = {
- substrDate: substrDate,
- indexOf:indexOf ,
- substrText:substrText,
- numRate:numRate,
- learnTime:learnTime,
- learnTimeHour:learnTimeHour,
- learnTimeMinute:learnTimeMinute
- }
|