Commit 3bf49588 by gdj

任务统计修改bug

parent 7cdc2a09
......@@ -447,7 +447,8 @@ public class WaylineJobServiceImpl implements IWaylineJobService {
if (timeType == 1) {
// 按“周”分组
// 输出每周的分组
String[] weekLabels = {"前六周", "前五周", "前四周", "前三周", "前两周", "前一周", "本周", "后一周", "后两周", "后三周", "后四周", "后五周"};
// String[] weekLabels = {"前六周", "前五周", "前四周", "前三周", "前两周", "前一周", "本周", "后一周", "后两周", "后三周", "后四周", "后五周"};
String[] weekLabels = {"6 weeks ago", "5 weeks ago", "4 weeks ago", "3 weeks ago", "2 weeks ago", "1 weeks ago", "this week", "1 week later", "2 week later", "3 week later", "4 week later", "5 week later"};
// 获取当前日期和周的起始日期(周一)
WeekFields weekFields = WeekFields.of(Locale.getDefault()); // 获取当前地区的周规则
......@@ -465,7 +466,7 @@ public class WaylineJobServiceImpl implements IWaylineJobService {
// 获取每个日期所在的周的起始日期(周一)
LocalDate startOfCurrentWeek = curDate.with(weekFields.dayOfWeek(), 1);
// 计算这个周属于第几组,负数为前面几周,正数为后面几周
int weekIndex = (int) startOfCurrentWeek.until(startOfWeek, java.time.temporal.ChronoUnit.WEEKS);
int weekIndex = (int) startOfWeek.until(startOfCurrentWeek, java.time.temporal.ChronoUnit.WEEKS);
// 确保index在-6到+5之间(即12个周)
if (weekIndex >= -6 && weekIndex <= 5) {
// 将日期添加到相应的周组
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment