@Override public LocalDate convert(LocalDateTime source) { return source.toLocalDate(); } }
@Override public LocalDate convert(LocalDateTime source) { return source.toLocalDate(); } }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
if (text.length() == 23) { LocalDateTime localDateTime = LocalDateTime.parse(text); localDate = localDateTime.toLocalDate(); } else { localDate = parseLocalDate(text, format, formatter); return (T) localDateTime.toLocalDate();
if (text.length() == 23) { LocalDateTime localDateTime = LocalDateTime.parse(text); localDate = localDateTime.toLocalDate(); } else { localDate = parseLocalDate(text, format, formatter); return (T) localDateTime.toLocalDate();
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
@Override public LocalDate convert(LocalDateTime source) { return source.toLocalDate(); } }
@Override public Object parseObject(String source) throws ParseException { if ((source.length() >= 1) && ((source.charAt(0) == '+') || ((source.charAt(0) == '-')))) { return transformText(source, pattern).toLocalDate(); } if (StringUtils.isBlank(source)) { return null; } return super.parseObject(source); } }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
/** * Parses only the local date from the given text, returning a new LocalDate. * <p> * This will parse the text fully according to the formatter, using the UTC zone. * Once parsed, only the local date will be used. * This means that any parsed time, time-zone or offset field is completely ignored. * It also means that the zone and offset-parsed settings are ignored. * * @param text the text to parse, not null * @return the parsed date, never null * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid * @since 2.0 */ public LocalDate parseLocalDate(String text) { return parseLocalDateTime(text).toLocalDate(); }
private Map<LocalDate, List<WebHookHistoryItem>> findHistoryItemsGroupedByDay(LocalDate untilDate, int numberOfDays, List<WebHookHistoryItem> items) { Map<LocalDate, List<WebHookHistoryItem>> groupedHistoryItems = new LinkedHashMap<>(numberOfDays); for (LocalDate thisDate : getArrayOfDates(untilDate, numberOfDays)) { List<WebHookHistoryItem> thisDateList = new ArrayList<>(); for (WebHookHistoryItem item : items) { if (thisDate.isEqual(item.getTimestamp().toLocalDate())) { thisDateList.add(item); } } groupedHistoryItems.put(thisDate, thisDateList); } return groupedHistoryItems; }
private List<WebHookHistoryItem> findAllItemsSince(LocalDate untilDate, int numberOfDays) { List<WebHookHistoryItem> erroredItemsSince = new ArrayList<>(); LocalDate sinceDate = untilDate.minusDays(numberOfDays); for (WebHookHistoryItem item : this.webHookHistoryItems.values()) { LocalDate itemTimeStamp = item.getTimestamp().toLocalDate(); if (sinceDate.isBefore(itemTimeStamp) && untilDate.isAfter(itemTimeStamp)) { erroredItemsSince.add(item); } } return erroredItemsSince; }
private List<WebHookHistoryItem> findItemsSince(LocalDate untilDate, int numberOfDays, boolean isErrored, boolean isDisabled) { List<WebHookHistoryItem> itemsSince = new ArrayList<>(); LocalDate sinceDate = untilDate.minusDays(numberOfDays); for (WebHookHistoryItem item : this.webHookHistoryItems.values()) { LocalDate itemTimeStamp = item.getTimestamp().toLocalDate(); if (sinceDate.isBefore(itemTimeStamp) && untilDate.isAfter(itemTimeStamp) && item.getWebHookExecutionStats().isErrored() == isErrored && item.getWebHookExecutionStats().isEnabled() != isDisabled) { itemsSince.add(item); } } return itemsSince; }
private void setBlockSubmittable(LeaveCalendarForm leaveForm, LeaveCalendarDocument lcd) { leaveForm.setBlockSubmittable(false); if(leaveForm != null) { // Do NOT use leaveForm.getStartDate - We don't know why it's there if (leaveForm.getCalendarEntry().getBeginPeriodFullDateTime() != null && StringUtils.isBlank(leaveForm.getDocumentId())) { if (LocalDate.now().isBefore(leaveForm.getCalendarEntry().getBeginPeriodLocalDateTime().toLocalDate())) { leaveForm.setBlockSubmittable(true); } } } }