Package org.ametys.core.util.date
Class AdaptableDateParser
- java.lang.Object
-
- org.ametys.core.util.date.AdaptableDateParser
-
public final class AdaptableDateParser extends Object
Class for parsing aString
and converting it to anAdaptableDate
.
See documentation ofparse(java.lang.String)
method.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
AdaptableDateParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AdaptableDate
parse(String value)
Parses the givenString
as anAdaptableDate
It accepts the following syntax:2019-01-01T09:30:00+01:00
to have astatic
date (based on theDateTimeFormatter.ISO_DATE_TIME
format)$current
to have thecurrent
date$ago$2$Minutes
to have a date in thepast
$in$3$Weeks
to have a date in thefuture
-
-
-
Field Detail
-
__SPECIAL_CHAR
private static final String __SPECIAL_CHAR
- See Also:
- Constant Field Values
-
__CURRENT
private static final String __CURRENT
- See Also:
- Constant Field Values
-
__AGO
private static final String __AGO
- See Also:
- Constant Field Values
-
__IN
private static final String __IN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AdaptableDateParser
private AdaptableDateParser()
-
-
Method Detail
-
parse
public static final AdaptableDate parse(String value)
Parses the givenString
as anAdaptableDate
It accepts the following syntax:2019-01-01T09:30:00+01:00
to have astatic
date (based on theDateTimeFormatter.ISO_DATE_TIME
format)$current
to have thecurrent
date$ago$2$Minutes
to have a date in thepast
$in$3$Weeks
to have a date in thefuture
- Parameters:
value
- The string value to parse- Returns:
- The
AdaptableDate
- Throws:
IllegalArgumentException
- if the string value cannot be parsed as anAdaptableDate
-
-