You need to sign in to do that
Don't have an account?

Need help finding LEAP YEARS in date ranges for contract expiration date to be correct via apex???
I have a system setup to allow contracts to create renewal contracts automatically. The problem is that if the range contains a leap year my expiration date is off.
Ideally what I need is if we have a date range that co-terms a new contract with an existing one where the total term is 3 years six months and 5 days, and there is a leap year in the range how do I examine each year and determine if a leap year is in the range?
I will give kudos to anyone that can help me out or direct me to a resource that has a solution to this issue.
Ideally what I need is if we have a date range that co-terms a new contract with an existing one where the total term is 3 years six months and 5 days, and there is a leap year in the range how do I examine each year and determine if a leap year is in the range?
I will give kudos to anyone that can help me out or direct me to a resource that has a solution to this issue.
Well, just use Date.isLeapYear() to check all the years in your range. Your term is a fixed number so it's easy to know what years you need to check.