Class DateRange


  • public class DateRange
    extends Object
    Model for the range between two dates.
    • Method Detail

      • dayRange

        public static DateRange dayRange()
        Returns:
        a new date range instance for the current day
      • dayRange

        public static DateRange dayRange​(LocalDate date)
        Returns:
        a new date range instance for the day that contains the provided date
      • weekRange

        public static DateRange weekRange()
        Returns:
        a new date range instance for the current week
      • weekRange

        public static DateRange weekRange​(LocalDate date)
        Returns:
        a new date range instance for the week that contains the provided date
      • monthRange

        public static DateRange monthRange()
        Returns:
        a new date range instance for the current month
      • monthRange

        public static DateRange monthRange​(LocalDate date)
        Returns:
        a new date range instance for the month that contains the provided date
      • yearRange

        public static DateRange yearRange()
        Returns:
        a new date range instance for the current year
      • yearRange

        public static DateRange yearRange​(int year)
        Returns:
        a new date range instance for the year that contains the provided date
      • from

        public static DateRange from​(org.apache.commons.lang3.tuple.Pair<Date,​Date> dates,
                                     ZoneId timeZoneId)
        Returns:
        a new date range instance, starting and ending with the dates of the provided date pair
      • calculateTimeScale

        public ETimeScale calculateTimeScale()
        Returns:
        the time scale related to this date range
      • ticks

        public int ticks()
        Returns:
        the (tickUnit depending) 'ticks' of this date range
      • previous

        public DateRange previous()
        Returns:
        the result of shifting this date range backward by one as a new date range instance
      • next

        public DateRange next()
        Returns:
        the result of shifting this date range forward by one as a new date range instance