mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-16 14:26:47 +08:00
feat:增加项目列表
This commit is contained in:
40
src/api/method.js
Normal file
40
src/api/method.js
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* @Author: lixg lixg@dongwu-inc.com
|
||||
* @Date: 2022-12-19 11:35:37
|
||||
* @LastEditors: lixg lixg@dongwu-inc.com
|
||||
* @LastEditTime: 2022-12-19 11:38:29
|
||||
* @FilePath: /fe-stu/src/views/project/method.js
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
// 修改时间格式---------start-----------------------------
|
||||
function formatNumber(n) {
|
||||
n = n.toString();
|
||||
return n[1] ? n : "0" + n;
|
||||
}
|
||||
|
||||
function toDate(number, format) {
|
||||
var formateArr = ["Y", "M", "D", "h", "m", "s"];
|
||||
var returnArr = [];
|
||||
|
||||
if (number === 0) {
|
||||
return 0;
|
||||
} else {
|
||||
var date = new Date(number * 1000);
|
||||
}
|
||||
returnArr.push(date.getFullYear());
|
||||
returnArr.push(formatNumber(date.getMonth() + 1));
|
||||
returnArr.push(formatNumber(date.getDate()));
|
||||
|
||||
returnArr.push(formatNumber(date.getHours()));
|
||||
returnArr.push(formatNumber(date.getMinutes()));
|
||||
returnArr.push(formatNumber(date.getSeconds()));
|
||||
|
||||
for (var i in returnArr) {
|
||||
format = format.replace(formateArr[i], returnArr[i]);
|
||||
}
|
||||
return format;
|
||||
}
|
||||
// 修改时间格式---------end-----------------------------
|
||||
export {
|
||||
toDate
|
||||
}
|
||||
Reference in New Issue
Block a user