Package exceptions

Examples of exceptions.InvalidDateException


  public static int getCurrentDay(Game game)
    throws InvalidDateException{
    DateTime startDate = new DateTime(game.getVirtualStartDate().getTime());
    DateTime currentDate = new DateTime(game.getVirtualCurrentDate().getTime());
    if (startDate.isAfter(currentDate))
      throw new InvalidDateException("Virtual start date cannot be after virtual current date.");
    // got from
    // http://stackoverflow.com/questions/3802893/number-of-days-between-two-dates-in-joda-time
    int diff = Days.daysBetween(startDate.toDateMidnight(),
        currentDate.toDateMidnight()).getDays();
View Full Code Here

TOP

Related Classes of exceptions.InvalidDateException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.