Class Dates


  • public final class Dates
    extends Object

    Expression Object for performing dates (Date) operations inside Thymeleaf Standard Expressions.

    An object of this class is usually available in variable evaluation expressions with the name #dates.

    Since:
    1.0
    Author:
    Daniel Fernández
    • Constructor Detail

      • Dates

        public Dates​(Locale locale)
    • Method Detail

      • create

        public Date create​(Object year,
                           Object month,
                           Object day)
        Parameters:
        year - year
        month - month
        day - day
        Returns:
        the result
        Since:
        1.1.2
      • create

        public Date create​(Object year,
                           Object month,
                           Object day,
                           Object hour,
                           Object minute)
        Parameters:
        year - year
        month - month
        day - day
        hour - hour
        minute - minute
        Returns:
        the result
        Since:
        1.1.2
      • create

        public Date create​(Object year,
                           Object month,
                           Object day,
                           Object hour,
                           Object minute,
                           Object second)
        Parameters:
        year - year
        month - month
        day - day
        hour - hour
        minute - minute
        second - second
        Returns:
        the result
        Since:
        1.1.2
      • create

        public Date create​(Object year,
                           Object month,
                           Object day,
                           Object hour,
                           Object minute,
                           Object second,
                           Object millisecond)
        Parameters:
        year - year
        month - month
        day - day
        hour - hour
        minute - minute
        second - second
        millisecond - millisecond
        Returns:
        the result
        Since:
        1.1.2
      • createNow

        public Date createNow()
        Returns:
        the result
        Since:
        1.1.2
      • createNowForTimeZone

        public Date createNowForTimeZone​(Object timeZone)
        Parameters:
        timeZone - timeZone
        Returns:
        the result
        Since:
        2.1.0
      • createToday

        public Date createToday()
        Returns:
        the result
        Since:
        1.1.2
      • createTodayForTimeZone

        public Date createTodayForTimeZone​(Object timeZone)
        Parameters:
        timeZone - timeZone
        Returns:
        the result
        Since:
        2.1.0
      • arrayFormat

        public String[] arrayFormat​(Object[] target)
      • monthName

        public String monthName​(Date target)
      • arrayMonthName

        public String[] arrayMonthName​(Object[] target)
      • setMonthName

        public Set<String> setMonthName​(Set<? extends Date> target)
      • monthNameShort

        public String monthNameShort​(Date target)
      • arrayMonthNameShort

        public String[] arrayMonthNameShort​(Object[] target)
      • listMonthNameShort

        public List<String> listMonthNameShort​(List<? extends Date> target)
      • setMonthNameShort

        public Set<String> setMonthNameShort​(Set<? extends Date> target)
      • dayOfWeek

        public Integer dayOfWeek​(Date target)
      • arrayDayOfWeek

        public Integer[] arrayDayOfWeek​(Object[] target)
      • dayOfWeekName

        public String dayOfWeekName​(Date target)
      • arrayDayOfWeekName

        public String[] arrayDayOfWeekName​(Object[] target)
      • listDayOfWeekName

        public List<String> listDayOfWeekName​(List<? extends Date> target)
      • setDayOfWeekName

        public Set<String> setDayOfWeekName​(Set<? extends Date> target)
      • dayOfWeekNameShort

        public String dayOfWeekNameShort​(Date target)
      • arrayDayOfWeekNameShort

        public String[] arrayDayOfWeekNameShort​(Object[] target)
      • listDayOfWeekNameShort

        public List<String> listDayOfWeekNameShort​(List<? extends Date> target)
      • setDayOfWeekNameShort

        public Set<String> setDayOfWeekNameShort​(Set<? extends Date> target)
      • arrayMinute

        public Integer[] arrayMinute​(Object[] target)
      • arraySecond

        public Integer[] arraySecond​(Object[] target)
      • millisecond

        public Integer millisecond​(Date target)
      • arrayMillisecond

        public Integer[] arrayMillisecond​(Object[] target)
      • setMillisecond

        public Set<Integer> setMillisecond​(Set<? extends Date> target)
      • formatISO

        public String formatISO​(Date target)
        Parameters:
        target - target
        Returns:
        the result
        Since:
        2.1.4
      • arrayFormatISO

        public String[] arrayFormatISO​(Object[] target)
        Parameters:
        target - target
        Returns:
        the result
        Since:
        2.1.4
      • listFormatISO

        public List<String> listFormatISO​(List<? extends Date> target)
        Parameters:
        target - target
        Returns:
        the result
        Since:
        2.1.4
      • setFormatISO

        public Set<String> setFormatISO​(Set<? extends Date> target)
        Parameters:
        target - target
        Returns:
        the result
        Since:
        2.1.4