Class DateBuilder

java.lang.Object
ch.tocco.nice2.optional.calendar.api.util.DateBuilder

public class DateBuilder extends Object

A convenience class for create date and date-time objects.

Please have a look at the test class for examples on how to use it.

  • Constructor Details

    • DateBuilder

      public DateBuilder()
  • Method Details

    • buildDateTime

      public org.joda.time.DateTime buildDateTime()
    • buildInstant

      public org.joda.time.Instant buildInstant()
      Creates a Instant. Note, if you only set time infos, this will default to 1970-01-01.
    • clear

      public DateBuilder clear()
      Clears all set values.
    • setDayOfMonth

      public DateBuilder setDayOfMonth(int dom)
    • setMonth

      public DateBuilder setMonth(int month)
    • setYear

      public DateBuilder setYear(int year)
    • setDate

      public DateBuilder setDate(String date)
      Sets the date (not time!!) from the string. Use
           yyyy-MM-dd
       
      pattern, for example: 2002-09-23.
    • setHour

      public DateBuilder setHour(int hour)
    • setMinute

      public DateBuilder setMinute(int min)
    • setSecond

      public DateBuilder setSecond(int sec)
    • setMillis

      public DateBuilder setMillis(int millis)
    • setTime

      public DateBuilder setTime(String time)
      Sets the time from the specified string. Use
           HH:mm[:ss]
       
      pattern, where the seconds are optional.