Skip to content

Commit

Permalink
Added support for ISOWEEK
Browse files Browse the repository at this point in the history
  • Loading branch information
Kowsikraja committed Dec 7, 2023
1 parent 66b52f1 commit 2125c7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* {@link #HOUR}, {@link #MINUTE}, {@link #SECOND} can be the unit of a SQL
* interval.
*
* <p>The others ({@link #QUARTER}, {@link #WEEK}, {@link #MILLISECOND},
* <p>The others ({@link #QUARTER}, {@link #WEEK}, {@link #ISOWEEK}, {@link #MILLISECOND},
* {@link #DOW}, {@link #DOY}, {@link #EPOCH}, {@link #DECADE}, {@link #CENTURY},
* {@link #MILLENNIUM}, {@link #MICROSECOND}, {@link #NANOSECOND}, {@link #ISODOW}
* and {@link #ISOYEAR}) are convenient to use internally,
Expand All @@ -48,6 +48,8 @@ public enum TimeUnit {
ISOYEAR(true, ' ', BigDecimal.valueOf(12) /* months */, null),
WEEK(false, '*', BigDecimal.valueOf(DateTimeUtils.MILLIS_PER_DAY * 7),
BigDecimal.valueOf(53)),
ISOWEEK(false, '*', BigDecimal.valueOf(DateTimeUtils.MILLIS_PER_DAY * 7),
BigDecimal.valueOf(53)),
MILLISECOND(false, '.', BigDecimal.ONE, BigDecimal.valueOf(1000)),
MICROSECOND(false, '.', BigDecimal.ONE.scaleByPowerOfTen(-3),
BigDecimal.valueOf(1000_000)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public enum TimeUnitRange {
ISOYEAR(TimeUnit.ISOYEAR, null),
QUARTER(TimeUnit.QUARTER, null),
WEEK(TimeUnit.WEEK, null),
ISOWEEK(TimeUnit.ISOWEEK, null),
MILLISECOND(TimeUnit.MILLISECOND, null),
MICROSECOND(TimeUnit.MICROSECOND, null),
NANOSECOND(TimeUnit.NANOSECOND, null),
Expand Down

0 comments on commit 2125c7e

Please sign in to comment.