richardantal commented on code in PR #1501: URL: https://github.com/apache/phoenix/pull/1501#discussion_r973606336
########## phoenix-core/src/main/java/org/apache/phoenix/expression/function/RoundWeekExpression.java: ########## @@ -17,25 +17,36 @@ */ package org.apache.phoenix.expression.function; +import java.util.Calendar; +import java.util.Date; import java.util.List; import org.apache.phoenix.expression.Expression; -import org.joda.time.DateTime; + +import static java.lang.Math.abs; /** * - * Rounds off the given {@link DateTime} to the nearest Monday. + * Rounds off the given {@link Date} to the nearest Monday. */ -public class RoundWeekExpression extends RoundJodaDateExpression { +public class RoundWeekExpression extends RoundJavaDateExpression { - public RoundWeekExpression(){} + public RoundWeekExpression() {} public RoundWeekExpression(List<Expression> children) { super(children); } @Override - public long roundDateTime(DateTime dateTime) { - return dateTime.weekOfWeekyear().roundHalfEvenCopy().getMillis(); + public long roundDateTime(Date dateTime) { + long nextMonday = new CeilWeekExpression().roundDateTime(dateTime); + long prevMonday = new FloorWeekExpression().roundDateTime(dateTime); Review Comment: I will check it again. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org