baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
+39
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
*
|
||||
* 获取对应当前时间的数组下标
|
||||
* year=>years|month=>months|day=>days|hour=>hours|minute=>minuyes|second=>seconds
|
||||
*/
|
||||
export const getTimeArrayIndex = (date,startYear)=>{
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth()+1;
|
||||
let day = date.getDate();
|
||||
const hour = date.getHours();
|
||||
const minute = date.getMinutes();
|
||||
const second = date.getSeconds();
|
||||
year = parseInt(year) - parseInt(startYear);
|
||||
month = parseInt(month) -1;
|
||||
day = parseInt(day) - 1;
|
||||
return [year,month,day,hour,minute,second];
|
||||
}
|
||||
/**
|
||||
*
|
||||
* 根据年,月获取当前月有几天
|
||||
*/
|
||||
export const getDays = (year,month)=>{
|
||||
month = Number(month);
|
||||
//
|
||||
const baseMonthsDays = [31,28,31,30,31,30,31,31,30,31,30,31];
|
||||
if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)){
|
||||
if(month === 2){
|
||||
baseMonthsDays[month - 1] = 29;
|
||||
}
|
||||
}
|
||||
return baseMonthsDays[month - 1];
|
||||
}
|
||||
/**
|
||||
* 小于10的数字前面补0
|
||||
*/
|
||||
export const addZero = (num)=>{
|
||||
return num < 10 ? '0' + num : num;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user