Browse Source

fix: function DATEDIF. Unit="YD" returns NaN

master
asundukov 3 years ago
parent
commit
880544edc2
  1. 5
      src/function/functionImplementation.js

5
src/function/functionImplementation.js

@ -12485,8 +12485,9 @@ const functionImplementation = {
result = (startM <= endM) ? endM - startM : endM + 12 - startM;
break;
case "YD":case "yd":
var startM = genarate(startDate.format('MM-DD'))[2];
var endM = genarate(endDate.format('MM-DD'))[2];
const format = `${endDate.$y}-MM-DD`;
var startM = genarate(startDate.format(format))[2];
var endM = genarate(endDate.format(format))[2];
result = (startM <= endM) ? endM - startM : endM + 365 - startM;
break;

Loading…
Cancel
Save