提交 30d95376 authored 作者: Stéphane Eintrazi's avatar Stéphane Eintrazi

Update code style

上级 c423cd92
...@@ -454,9 +454,9 @@ public final class DateTimeFunctions { ...@@ -454,9 +454,9 @@ public final class DateTimeFunctions {
} }
timeNanos = 0l; timeNanos = 0l;
break; break;
case MONTH: case MONTH:
long year = DateTimeUtils.yearFromDateValue(dateValue); long year = DateTimeUtils.yearFromDateValue(dateValue);
int month = DateTimeUtils.monthFromDateValue(dateValue); int month = DateTimeUtils.monthFromDateValue(dateValue);
dateValue = DateTimeUtils.dateValue(year, month, 1); dateValue = DateTimeUtils.dateValue(year, month, 1);
...@@ -468,6 +468,7 @@ public final class DateTimeFunctions { ...@@ -468,6 +468,7 @@ public final class DateTimeFunctions {
long yearForQuarter = DateTimeUtils.yearFromDateValue(dateValue); long yearForQuarter = DateTimeUtils.yearFromDateValue(dateValue);
int monthForQuarter = DateTimeUtils.monthFromDateValue(dateValue); int monthForQuarter = DateTimeUtils.monthFromDateValue(dateValue);
// Round the month to lower quarter
if (monthForQuarter >= 10) { if (monthForQuarter >= 10) {
monthForQuarter = 10; monthForQuarter = 10;
} else if (monthForQuarter >= 7) { } else if (monthForQuarter >= 7) {
...@@ -490,17 +491,17 @@ public final class DateTimeFunctions { ...@@ -490,17 +491,17 @@ public final class DateTimeFunctions {
break; break;
case DECADE: case DECADE:
long yearForDecade = DateTimeUtils.yearFromDateValue(dateValue); long yearForDecade = DateTimeUtils.yearFromDateValue(dateValue);
yearForDecade = (long) (Math.floor(yearForDecade / 10) * 10); yearForDecade = (long) (Math.floor(yearForDecade / 10) * 10);
dateValue = DateTimeUtils.dateValue(yearForDecade, 1, 1); dateValue = DateTimeUtils.dateValue(yearForDecade, 1, 1);
timeNanos = 0l; timeNanos = 0l;
break; break;
case CENTURY: case CENTURY:
long yearForCentury = DateTimeUtils.yearFromDateValue(dateValue); long yearForCentury = DateTimeUtils.yearFromDateValue(dateValue);
yearForCentury = (long) (Math.floor( (yearForCentury - 1) / 100) * 100) + 1; yearForCentury = (long) (Math.floor((yearForCentury - 1) / 100) * 100) + 1;
dateValue = DateTimeUtils.dateValue(yearForCentury, 1, 1); dateValue = DateTimeUtils.dateValue(yearForCentury, 1, 1);
timeNanos = 0l; timeNanos = 0l;
break; break;
...@@ -514,7 +515,7 @@ public final class DateTimeFunctions { ...@@ -514,7 +515,7 @@ public final class DateTimeFunctions {
break; break;
} }
if (timeNanos == null) { if (timeNanos == null) {
// Return an exception in the timeUnit is not recognized // Return an exception in the timeUnit is not recognized
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论