Using Fiscal year in calculation | Community
Skip to main content
ReluctantProgrammer
New Participant
July 13, 2022
Solved

Using Fiscal year in calculation

  • July 13, 2022
  • 1 reply
  • 785 views

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.

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Gandhi

@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
}
 

  

1 reply

Mayank_Gandhi
Mayank_GandhiAccepted solution
Employee
July 14, 2022

@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
}
 

  

ReluctantProgrammer
New Participant
July 14, 2022

I will try it out...thank you