Enum Class RelativeDateShortcut

java.lang.Object
java.lang.Enum<RelativeDateShortcut>
com.isomorphic.util.date.RelativeDateShortcut
All Implemented Interfaces:
Serializable, Comparable<RelativeDateShortcut>, Constable

public enum RelativeDateShortcut extends Enum<RelativeDateShortcut>
Shortcuts for relative dates. These are handy if you simply want to use a common name such as today, tomorrow, yesterday etc.
  • Method Details

    • getShortcut

      public String getShortcut()
      Returns the shortcut string which can be used to construct a RelativeDate.
      Returns:
      the shortcut string.
    • toRelativeDateString

      public String toRelativeDateString(RelativeDateRangePosition relativeDataRangePosition)
      Returns the relative date string representation of this shortcut.
      Returns:
      the relative date string.
    • parseShortcut

      public static RelativeDateShortcut parseShortcut(String shortcut)
      Parses a shortcut string into a relative date shortcut.
      Parameters:
      shortcut - the shortcut string, $today, $tomorrow, $endOfYear etc.
      Returns:
      the matching relative date shortcut or null if unable to parse.