Updated code
This commit is contained in:
@@ -1649,14 +1649,11 @@ public class ApplicationDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static LocalDateTime parseStringToLocalDateTime(String timestampStr) {
|
|
||||||
// Use ISO_LOCAL_DATE_TIME to parse the input string
|
|
||||||
return LocalDateTime.parse(timestampStr, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void applyDateFilter(Path<?> fieldPath, CriteriaBuilder criteriaBuilder, List<Predicate> predicates, Object value, MatchModeEnum matchMode, Root<?> root) {
|
private void applyDateFilter(Path<?> fieldPath, CriteriaBuilder criteriaBuilder, List<Predicate> predicates, Object value, MatchModeEnum matchMode, Root<?> root) {
|
||||||
if (fieldPath.getJavaType().equals(LocalDateTime.class)) {
|
if (fieldPath.getJavaType().equals(LocalDateTime.class)) {
|
||||||
LocalDateTime testDateTime = parseStringToLocalDateTime(value.toString());
|
LocalDateTime testDateTime = DateTimeUtil.parseStringToLocalDateTime(value.toString());
|
||||||
MatchModeEnum mode = MatchModeEnum.fromObject(matchMode.getValue());
|
MatchModeEnum mode = MatchModeEnum.fromObject(matchMode.getValue());
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ public class DateTimeUtil {
|
|||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
return LocalDateTime.parse(dateTimeStr, formatter);
|
return LocalDateTime.parse(dateTimeStr, formatter);
|
||||||
}
|
}
|
||||||
|
public static LocalDateTime parseStringToLocalDateTime(String timestampStr) {
|
||||||
|
// Use ISO_LOCAL_DATE_TIME to parse the input string
|
||||||
|
return LocalDateTime.parse(timestampStr, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
public static String parseLocalTimeToString(LocalTime time, String format) {
|
public static String parseLocalTimeToString(LocalTime time, String format) {
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||||
|
|||||||
Reference in New Issue
Block a user