提交 0c9573ed 编写于 作者: Y youyong205

modify the payload

上级 8214fb0d
......@@ -50,6 +50,19 @@ public abstract class AbstractReportPayload<A extends Action, P extends Page> im
m_defaultPage = defaultPage;
}
private void checkFutureDate() {
if ("day".equals(m_reportType)) {
Calendar today = Calendar.getInstance();
long current = getCurrentDate();
today.setTimeInMillis(current);
today.set(Calendar.HOUR_OF_DAY, 0);
if (m_date == today.getTimeInMillis()) {
m_date = m_date - 24 * TimeHelper.ONE_HOUR;
}
}
}
public void computeHistoryDate() {
if (m_date <= 0) {
m_date = TimeHelper.getCurrentDay(-1).getTime();
......@@ -96,7 +109,7 @@ public abstract class AbstractReportPayload<A extends Action, P extends Page> im
}
}
setYesterdayDefault();
checkFutureDate();
}
public long getCurrentDate() {
......@@ -259,18 +272,4 @@ public abstract class AbstractReportPayload<A extends Action, P extends Page> im
m_step = nav;
}
// yestoday is default
private void setYesterdayDefault() {
if ("day".equals(m_reportType)) {
Calendar today = Calendar.getInstance();
long current = getCurrentDate();
today.setTimeInMillis(current);
today.set(Calendar.HOUR_OF_DAY, 0);
if (m_date == today.getTimeInMillis()) {
m_date = m_date - 24 * TimeHelper.ONE_HOUR;
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册