日期判断问题
This commit is contained in:
parent
a92d717c5f
commit
5658bfde75
@ -190,19 +190,21 @@ const getDetailMsg = (row) =>{
|
||||
if(row.twoDimDate != null && row.lastDate != null ){
|
||||
const starttemp = new Date(row.twoDimDate);
|
||||
starttemp.setHours(23,59,59,999);
|
||||
const endtemp = new Date(row.lastDate);
|
||||
endtemp.setHours(23,59,59,999);
|
||||
const start =starttemp.getTime()
|
||||
const end = new Date(row.lastDate).getTime();
|
||||
const end = endtemp.getTime();
|
||||
const diffTime = Math.abs(end - start);
|
||||
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
if(day == 0){
|
||||
if(row.isDelay == 1 && row.lastDate > row.blankDate){
|
||||
if(row.isDelay == 1 && row.lastDate > starttemp){
|
||||
return '延后' + (day+1) +'天';
|
||||
}
|
||||
return '按时完成'
|
||||
}else{
|
||||
if(row.lastDate > row.blankDate){
|
||||
if(row.lastDate > starttemp){
|
||||
return '延后' + day +'天';
|
||||
}else if (row.lastDate < row.blankDate){
|
||||
}else if (row.lastDate < starttemp){
|
||||
return '提前' + day +'天';
|
||||
}else{
|
||||
return '按时完成'
|
||||
|
@ -240,19 +240,21 @@ const getDetailMsg = (row) =>{
|
||||
if(row.threeDimDate != null && row.lastDate != null ){
|
||||
const starttemp = new Date(row.threeDimDate);
|
||||
starttemp.setHours(23,59,59,999);
|
||||
const endtemp = new Date(row.lastDate);
|
||||
endtemp.setHours(23,59,59,999);
|
||||
const start =starttemp.getTime()
|
||||
const end = new Date(row.lastDate).getTime();
|
||||
const end = endtemp.getTime();
|
||||
const diffTime = Math.abs(end - start);
|
||||
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
if(day == 0){
|
||||
if(row.isDelay == 1 && row.lastDate > row.blankDate){
|
||||
if(row.isDelay == 1 && row.lastDate > starttemp){
|
||||
return '延后' + (day+1) +'天';
|
||||
}
|
||||
return '按时完成'
|
||||
}else{
|
||||
if(row.lastDate > row.blankDate){
|
||||
if(row.lastDate > starttemp){
|
||||
return '延后' + day +'天';
|
||||
}else if (row.lastDate < row.blankDate){
|
||||
}else if (row.lastDate < starttemp){
|
||||
return '提前' + day +'天';
|
||||
}else{
|
||||
return '按时完成'
|
||||
|
@ -208,19 +208,21 @@ const getDetailMsg = (row) =>{
|
||||
if(row.craftEndDate != null && row.lastDate != null ){
|
||||
const starttemp = new Date(row.craftEndDate);
|
||||
starttemp.setHours(23,59,59,999);
|
||||
const endtemp = new Date(row.lastDate);
|
||||
endtemp.setHours(23,59,59,999);
|
||||
const start =starttemp.getTime()
|
||||
const end = new Date(row.lastDate).getTime();
|
||||
const end = endtemp.getTime();
|
||||
const diffTime = end - start
|
||||
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
if(day == 0){
|
||||
if(row.isDelay == 1 && row.lastDate > row.blankDate){
|
||||
if(row.isDelay == 1 && row.lastDate > starttemp){
|
||||
return '延后' + (day+1) +'天';
|
||||
}
|
||||
return '按时完成'
|
||||
}else{
|
||||
if(row.lastDate > row.blankDate){
|
||||
if(row.lastDate > starttemp){
|
||||
return '延后' + day +'天';
|
||||
}else if (row.lastDate < row.blankDate){
|
||||
}else if (row.lastDate < starttemp){
|
||||
return '提前' + day +'天';
|
||||
}else{
|
||||
return '按时完成'
|
||||
|
@ -189,8 +189,10 @@ const getDetailMsg = (row) =>{
|
||||
if(row.blankDate != null && row.lastDate != null ){
|
||||
const starttemp = new Date(row.blankDate);
|
||||
starttemp.setHours(23,59,59,999);
|
||||
const endtemp = new Date(row.lastDate);
|
||||
endtemp.setHours(23,59,59,999);
|
||||
const start =starttemp.getTime()
|
||||
const end = new Date(row.lastDate).getTime();
|
||||
const end = endtemp.getTime();
|
||||
const diffTime = Math.abs(end - start);
|
||||
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
if(day == 0){
|
||||
|
Loading…
Reference in New Issue
Block a user