Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

import java.util.Date;

public class Main {
    /**
     * Check the schedule has expired or not
     * 
     * @param endDate
     * @return
     */
    public static boolean hasNotExpired(Date endDate) {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DAY_OF_MONTH, -1);

        // Check expired date
        return (endDate == null || cal.getTime().before(endDate));
    }
}