Class CalendarDateTimeUtils
java.lang.Object
io.jmix.fullcalendarflowui.kit.component.CalendarDateTimeUtils
INTERNAL.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDateTime
parseAndTransform
(String isoDateTime, ZoneId zoneId) Parses raw ISO date time toZonedDateTime
with the zoneId and then transform this value toLocalDateTime
with system default time zone.static LocalDate
parseIsoDate
(String isoDate) Parses date from ISO string.static ZonedDateTime
parseIsoDateTime
(String isoDateTime, ZoneId zoneId) Parses date-time or date from ISO string.static LocalTime
transformToLocalTime
(Object time) Obtains an instance of LocalTime from Time or Date or LocalTime or OffsetTimestatic Object
transformToType
(Object date, Class javaType, ZoneId zoneId) Converts a date instance to the passed java type corresponding to one of the date types.static ZonedDateTime
transformToZDT
(Object date, ZoneId fromZoneId) Obtains an instance ofZonedDateTime
from Date or LocalDate or LocalDateTime or OffsetDateTime ZonedDateTime is created for LocalDate, LocalDateTime with default system timezone
-
Constructor Details
-
CalendarDateTimeUtils
public CalendarDateTimeUtils()
-
-
Method Details
-
transformToType
Converts a date instance to the passed java type corresponding to one of the date types.- Parameters:
date
- the date object, notnull
javaType
- the java type to convert tozoneId
- the zone ID to use ornull
to use default system timezone- Returns:
- the date object converted to the passed java type, not
null
-
transformToZDT
Obtains an instance ofZonedDateTime
from Date or LocalDate or LocalDateTime or OffsetDateTime ZonedDateTime is created for LocalDate, LocalDateTime with default system timezone- Parameters:
date
- date object, not null- Returns:
- the ZonedDateTime, not null
- Throws:
IllegalArgumentException
- if the type of the provided date is not supported
-
transformToLocalTime
Obtains an instance of LocalTime from Time or Date or LocalTime or OffsetTime- Parameters:
time
- the time object to transform- Returns:
- local time instance
- Throws:
IllegalArgumentException
- if the type of the provided time is not supported
-
parseIsoDate
Parses date from ISO string.- Parameters:
isoDate
- date in ISO format- Returns:
- local date instance
- Throws:
DateTimeParseException
- if the provided date cannot be parsed
-
parseIsoDateTime
Parses date-time or date from ISO string.- Parameters:
isoDateTime
- date-time in ISO formatzoneId
- zoneId if the provided date-time does contain time zone- Returns:
ZonedDateTime
instance- Throws:
DateTimeParseException
- if the provided date-time cannot be parsed
-
parseAndTransform
Parses raw ISO date time toZonedDateTime
with the zoneId and then transform this value toLocalDateTime
with system default time zone.- Parameters:
isoDateTime
- raw ISO date timezoneId
- zoneId to transform- Returns:
- local date time
-