Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Using Fiscal year in calculation

Avatar

Level 5

I have a formula that defines a rate based on the year...   

}else if(Row2.YearTraveled.rawValue == "2022" && Row2.ddModeTransportation.rawValue == "Motorcycle"){
this.rawValue = ".605";
}

Now I need to break up this year to calculate based on time frames....1/1/22-6/30/22  is one rate and 7/1/22-12/31/22 is another.

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@ReluctantProgrammer should be doable

var d1 = new Date(); // start date
var d2 = new Date(d1); end date

console.log(d1 == d2);   // prints false (wrong!) 
console.log(d1 === d2);  // prints false (wrong!)
console.log(d1 != d2);   // prints true  (wrong!)
console.log(d1 !== d2);  // prints true  (wrong!)

similarly you can write if else (somedate>d1 && somedate <d2) {
//do some action
}
 

  

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

@ReluctantProgrammer should be doable

var d1 = new Date(); // start date
var d2 = new Date(d1); end date

console.log(d1 == d2);   // prints false (wrong!) 
console.log(d1 === d2);  // prints false (wrong!)
console.log(d1 != d2);   // prints true  (wrong!)
console.log(d1 !== d2);  // prints true  (wrong!)

similarly you can write if else (somedate>d1 && somedate <d2) {
//do some action
}