java.lang.Object
jfxtras.icalendarfx.utilities.DateTimeUtilities
Temporal date and date-time types and supporting methods for iCalendar.
DATE
DATE_WITH_LOCAL_TIME
DATE_WITH_LOCAL_TIME_AND_TIME_ZONE
DATE_WITH_UTC_TIME:
see iCalendar RFC 5545, page 32-33
includes methods to format a Temporal representing a DateTimeType as a String
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
static final DateTimeUtilities.DateTimeType
Default DateTimeType to use when none is specified.private static final ZoneId
static final DateTimeFormatter
static final DateTimeFormatter
(package private) static final DateTimeFormatter
static final Comparator<Temporal>
Compares two temporals of the same typestatic final Comparator<Temporal>
Compares two temporals of the LocalDate, LocalDateTime and ZonedDateTime Makes LocalDate at start of day.(package private) static final DateTimeFormatter
static final DateTimeFormatter
static final DateTimeFormatter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
checkScheduleConflict
(VEvent vEvent, List<VEvent> vEvents) Check if schedule conflict exists forOPAQUE
events using default check quantitystatic String
checkScheduleConflict
(VEvent vEvent, List<VEvent> vEvents, int checkQuantity) Check if schedule conflict exists forOPAQUE
events.static DayOfWeek
dayOfWeekFromAbbreviation
(String dayOfWeekAbbreviation) Convert 2-character string to DayOfWeek following below convention: weekday = "SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA" Corresponding to SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, and SATURDAY days of the week.static final Comparator<Temporal>
Returns correct comparator based on Temporal parameterstatic boolean
Determines if Temporal is after t2 Works for LocalDate, LocalDateTime and ZonedDateTimestatic boolean
Determines if Temporal is before t2 Works for LocalDate, LocalDateTime and ZonedDateTimestatic TemporalAmount
temporalAmountBetween
(Temporal startInclusive, Temporal endExclusive) Calculate TemporalAmount between two Temporals.static Temporal
temporalFromString
(String string) Parse ISO.8601 string into LocalDate, LocalDateTime or ZonedDateTime Temporal object.static String
temporalToString
(Temporal temporal) produced ISO.8601 date and date-time string for given Temporal of type LocalDate, LocalDateTime or ZonedDateTimestatic LocalDateTime
toLocalDateTime
(Temporal temporal) Deprecated.static int
weekOrdinalInMonth
(Temporal dateBasedTemporal) returns week of month.
-
Field Details
-
DEFAULT_ZONE
-
DEFAULT_DATE_TIME_TYPE
Default DateTimeType to use when none is specified. For example, when a date-only component is converted to a date-time one. -
LOCAL_DATE_FORMATTER
-
LOCAL_TIME_FORMATTER
-
LOCAL_DATE_TIME_FORMATTER
-
ZONED_DATE_TIME_UTC_FORMATTER
-
ZONED_DATE_TIME_FORMATTER
-
ZONE_FORMATTER
-
TEMPORAL_COMPARATOR
Compares two temporals of the same type -
TEMPORAL_COMPARATOR2
Compares two temporals of the LocalDate, LocalDateTime and ZonedDateTime Makes LocalDate at start of day. Add system default ZoneId to LocalDate and LocalDateTime -
CONFLICT_CHECK_QUANTITY
private static final int CONFLICT_CHECK_QUANTITY- See Also:
-
-
Constructor Details
-
DateTimeUtilities
private DateTimeUtilities()
-
-
Method Details
-
getTemporalComparator
Returns correct comparator based on Temporal parameter -
isBefore
Determines if Temporal is before t2 Works for LocalDate, LocalDateTime and ZonedDateTime- Parameters:
t1
- first Temporalt2
- second Temporal (to compare with t1)- Returns:
- true if t1 is before t2, false otherwise
-
isAfter
Determines if Temporal is after t2 Works for LocalDate, LocalDateTime and ZonedDateTime- Parameters:
t1
- first Temporalt2
- second Temporal (to compare with t1)- Returns:
- true if t1 is after t2, false otherwise
-
checkScheduleConflict
Check if schedule conflict exists forOPAQUE
events using default check quantity- Parameters:
vEvent
- event to testvEvents
- existing events- Returns:
- UID and start of recurrence of conflicting event, null otherwise
-
checkScheduleConflict
Check if schedule conflict exists forOPAQUE
events.- Parameters:
vEvent
- event to testvEvents
- existing eventscheckQuantity
- amount of recurrences to be tested- Returns:
- UID and start of recurrence of conflicting event, null otherwise
-
weekOrdinalInMonth
returns week of month. For example, a LocalDate representing March 10, 2016 returns 2, for the 2nd Thursday.- Parameters:
dateBasedTemporal
- - date based Temporal, such as LocalDate- Returns:
- - ordinal week in month, such as 2nd (as in 2nd Wednesday in month)
-
temporalAmountBetween
Calculate TemporalAmount between two Temporals. Both temporals must be the same type and representations of a DateTimeType.- Parameters:
startInclusive
- - the start temporal, not nullendExclusive
- - the end temporal, not null- Returns:
- - Period for DATE, Duration for all other DateTimeTypes
-
temporalToString
produced ISO.8601 date and date-time string for given Temporal of type LocalDate, LocalDateTime or ZonedDateTime- Parameters:
temporal
-- Returns:
-
temporalFromString
Parse ISO.8601 string into LocalDate, LocalDateTime or ZonedDateTime Temporal object. -
dayOfWeekFromAbbreviation
Convert 2-character string to DayOfWeek following below convention: weekday = "SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA" Corresponding to SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, and SATURDAY days of the week.- Parameters:
dayOfWeekAbbreviation
- - 2 character abbreviation representing day of the week- Returns:
- - associated DayOfWeek
-
toLocalDateTime
Deprecated.Returns LocalDateTime from Temporal that is an instance of either LocalDate, LocalDateTime or ZonedDateTime If the parameter is type LocalDate the returned LocalDateTime is atStartofDay. If the parameter is type ZonedDateTime the zoneID is changed to ZoneId.systemDefault() before taking the LocalDateTime.
-