Package org.ametys.plugins.survey
Class SurveyDateUtils
- java.lang.Object
-
- org.ametys.plugins.survey.SurveyDateUtils
-
public final class SurveyDateUtils extends Object
Survey date utils FIXME When the plugins Survey will be not compatible with 4.2.x version, use the methods inDateUtils
See issue SURVEY-208
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SurveyDateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Calendar
asCalendar(ZonedDateTime zonedDateTime)
Converts thisZonedDateTime
object to aCalendar
.static ZonedDateTime
asZonedDateTime(Calendar calendar)
Converts thisCalendar
object to aZonedDateTime
.static ZonedDateTime
parseZonedDateTime(String zonedDateTimeAsString)
Parses a String into aZonedDateTime
, using ISO date formatter.static String
zonedDateTimeToString(ZonedDateTime zonedDateTime)
Converts aZonedDateTime
object toString
using the ISO date formatter
-
-
-
Constructor Detail
-
SurveyDateUtils
private SurveyDateUtils()
-
-
Method Detail
-
asZonedDateTime
public static ZonedDateTime asZonedDateTime(Calendar calendar)
Converts thisCalendar
object to aZonedDateTime
.- Parameters:
calendar
- the calendar- Returns:
- an instant representing the same point on the time-line as this
Calendar
object
-
asCalendar
public static Calendar asCalendar(ZonedDateTime zonedDateTime)
Converts thisZonedDateTime
object to aCalendar
.- Parameters:
zonedDateTime
- the zoned date time- Returns:
- the
Calendar
object
-
zonedDateTimeToString
public static String zonedDateTimeToString(ZonedDateTime zonedDateTime)
Converts aZonedDateTime
object toString
using the ISO date formatter- Parameters:
zonedDateTime
- the zoned date time- Returns:
- the zoned date time as a
String
-
parseZonedDateTime
public static ZonedDateTime parseZonedDateTime(String zonedDateTimeAsString)
Parses a String into aZonedDateTime
, using ISO date formatter.- Parameters:
zonedDateTimeAsString
- the zoned date time as string- Returns:
- the
ZonedDateTime
object
-
-