Package com.isomorphic.util.date
Enum Class RelativeDateShortcut
- All Implemented Interfaces:
Serializable,Comparable<RelativeDateShortcut>,Constable
Shortcuts for relative dates. These are handy if you simply want to use a common name such as today, tomorrow, yesterday etc.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the shortcut string which can be used to construct aRelativeDate.static RelativeDateShortcutparseShortcut(String shortcut) Parses a shortcut string into a relative date shortcut.toRelativeDateString(RelativeDateRangePosition relativeDataRangePosition) Returns the relative date string representation of this shortcut.
-
Method Details
-
getShortcut
Returns the shortcut string which can be used to construct aRelativeDate.- Returns:
- the shortcut string.
-
toRelativeDateString
Returns the relative date string representation of this shortcut.- Returns:
- the relative date string.
-
parseShortcut
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.
-