Class GanttUtil

java.lang.Object
org.vaadin.tltv.gantt.util.GanttUtil

public class GanttUtil extends Object
  • Constructor Details

    • GanttUtil

      public GanttUtil()
  • Method Details

    • formatDateTime

      public static String formatDateTime(TemporalAccessor temporal)
      Format given TemporalAccessor to datetime format yyyy-MM-ddTHH:mm:ss.
      Parameters:
      temporal - Target datetime
      Returns:
      Formatted datetime
    • parseDateTime

      public static TemporalAccessor parseDateTime(CharSequence text)
    • formatDate

      public static String formatDate(TemporalAccessor temporal)
      Format given TemporalAccessor to date format yyyy-MM-dd.
      Parameters:
      temporal - Target date
      Returns:
      Formatted date
    • parseDate

      public static TemporalAccessor parseDate(CharSequence text)
    • formatDateHour

      public static String formatDateHour(TemporalAccessor temporal)
    • parseDateHour

      public static TemporalAccessor parseDateHour(CharSequence text)
    • parse

      public static TemporalAccessor parse(CharSequence text)
    • parseLocalDateTime

      public static LocalDateTime parseLocalDateTime(CharSequence text)
    • resetTimeToMin

      public static LocalDateTime resetTimeToMin(LocalDateTime dateTime, Resolution resolution)
      Reset given datetime to minimum for the given resolution. Truncates to ChronoUnit.DAYS for Day and Week resoutions. Truncates to ChronoUnit.HOURS for Hour resoution.
      Parameters:
      dateTime - target datetime
      resolution - target resolution
      Returns:
      Truncated LocalDateTime or 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 be exclusive which means that given date or hour is either excluded with a true or included with false.
      Parameters:
      dateTime - target datetime
      resolution - target resolution
      exclusive - exclusive maximum
      Returns:
      Adjusted LocalDateTime or null with a null date.