Cherry-picked from #49153 Co-authored-by: yujun <yujun@selectdb.com>
This commit is contained in:
committed by
GitHub
parent
6430ff365d
commit
44b868de6b
@ -463,7 +463,7 @@ public class DateTimeExtractAndTransform {
|
||||
}
|
||||
|
||||
private static LocalDateTime toMonday(LocalDateTime dateTime) {
|
||||
LocalDateTime specialUpperBound = LocalDateTime.of(1970, 1, 4, 0, 0, 0);
|
||||
LocalDateTime specialUpperBound = LocalDateTime.of(1970, 1, 4, 23, 59, 59, 999_999_999);
|
||||
LocalDateTime specialLowerBound = LocalDateTime.of(1970, 1, 1, 0, 0, 0);
|
||||
if (dateTime.isAfter(specialUpperBound) || dateTime.isBefore(specialLowerBound)) {
|
||||
return dateTime.plusDays(-dateTime.getDayOfWeek().getValue() + 1);
|
||||
|
||||
Reference in New Issue
Block a user