function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Beatriz MinguezBeatriz Minguez 

How to call a Procedure with Dates


How can I call the procedure CheckDates with two dates? VerifyDate.CheckDates('310/01/2015', '30/02/2016') is giving me an error as they are treating the parameters as two strings.. 

public class VerifyDate {
    
    //method to handle potential checks against two dates
    public static Date CheckDates(Date date1, Date date2) {
        //if date2 is within the next 30 days of date1, use date2.  Otherwise use the end of the month
        if(DateWithin30Days(date1,date2)) {
            return date2;
        } else {
            return SetEndOfMonthDate(date1);
        }
    }

Can anyone help me?

Thanks,

Bea