Package org.vaadin.tltv.gantt.util
Class GanttUtil
java.lang.Object
org.vaadin.tltv.gantt.util.GanttUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatDate(TemporalAccessor temporal) Format givenTemporalAccessorto date format yyyy-MM-dd.static StringformatDateHour(TemporalAccessor temporal) static StringformatDateTime(TemporalAccessor temporal) Format givenTemporalAccessorto datetime format yyyy-MM-ddTHH:mm:ss.static TemporalAccessorparse(CharSequence text) static TemporalAccessorparseDate(CharSequence text) static TemporalAccessorparseDateHour(CharSequence text) static TemporalAccessorparseDateTime(CharSequence text) static LocalDateTimestatic LocalDateTimeresetTimeToMax(LocalDateTime dateTime, Resolution resolution, boolean exclusive) Reset given datetime to timeline maximum for the given resolution.static LocalDateTimeresetTimeToMin(LocalDateTime dateTime, Resolution resolution) Reset given datetime to minimum for the given resolution.
-
Constructor Details
-
GanttUtil
public GanttUtil()
-
-
Method Details
-
formatDateTime
Format givenTemporalAccessorto datetime format yyyy-MM-ddTHH:mm:ss.- Parameters:
temporal- Target datetime- Returns:
- Formatted datetime
-
parseDateTime
-
formatDate
Format givenTemporalAccessorto date format yyyy-MM-dd.- Parameters:
temporal- Target date- Returns:
- Formatted date
-
parseDate
-
formatDateHour
-
parseDateHour
-
parse
-
parseLocalDateTime
-
resetTimeToMin
Reset given datetime to minimum for the given resolution. Truncates toChronoUnit.DAYSfor Day and Week resoutions. Truncates toChronoUnit.HOURSfor Hour resoution.- Parameters:
dateTime- target datetimeresolution- target resolution- Returns:
- Truncated
LocalDateTimeor null with a null date.
-
resetTimeToMax
public static LocalDateTime resetTimeToMax(LocalDateTime dateTime, Resolution resolution, boolean exclusive) Reset given datetime to timeline maximum for the given resolution. Truncates or adds to last second of the day for Day and Week resoutions. Truncates or adds to last second of hour for Hour resoution. Maximum can beexclusivewhich means that given date or hour is either excluded with atrueor included withfalse.- Parameters:
dateTime- target datetimeresolution- target resolutionexclusive- exclusive maximum- Returns:
- Adjusted
LocalDateTimeor null with a null date.
-