public static String getEventDateVar(String event, String var) {
        var = var.toLowerCase();
        if (event == null || var.endsWith("date") || var.endsWith("dat")) return var;
        if (event.equals("planting")) {
            var = "pdate";
        } else if (event.equals("irrigation")) {
            var = "idate";
        } else if (event.equals("fertilizer")) {
            var = "fedate";
        } else if (event.equals("tillage")) {
            var = "tdate";
        } else if (event.equals("harvest")) {
            var = "hadat";
        } else if (event.equals("organic_matter")) {
            var = "omdat";
        } else if (event.equals("chemicals")) {
            var = "cdate";
        } else if (event.equals("mulch-apply")) {
            var = "mladat";
        } else if (event.equals("mulch-remove")) {
            var = "mlrdat";
        }
        return var;
    }
public static String getEventDateVar ( String event , String var ) { var = var . toLowerCase ( ) ; if ( event == null || var . endsWith ( "date" ) || var . endsWith ( "dat" ) ) return var ; if ( event . equals ( "planting" ) ) { var = "pdate" ; } else if ( event . equals ( "irrigation" ) ) { var = "idate" ; } else if ( event . equals ( "fertilizer" ) ) { var = "fedate" ; } else if ( event . equals ( "tillage" ) ) { var = "tdate" ; } else if ( event . equals ( "harvest" ) ) { var = "hadat" ; } else if ( event . equals ( "organic_matter" ) ) { var = "omdat" ; } else if ( event . equals ( "chemicals" ) ) { var = "cdate" ; } else if ( event . equals ( "mulch-apply" ) ) { var = "mladat" ; } else if ( event . equals ( "mulch-remove" ) ) { var = "mlrdat" ; } return var ; }
Renames a date variable from an event