Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Sep 9, 2022
1 parent 1e2c3da commit bbd77e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 5 additions & 4 deletions std-bits/base/src/main/java/org/enso/base/Time_Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,12 @@ public static LocalTime parse_time(String text, String pattern, Locale locale) {
return (LocalTime.parse(text, formatter.withLocale(locale)));
}

/** Normally this method could be done in Enso by pattern matching,
* but currently matching on Time types is not supported, so this is a workaround.
/**
* Normally this method could be done in Enso by pattern matching, but currently matching on Time
* types is not supported, so this is a workaround.
*
* TODO once the related issue is fixed, this workaround may be replaced with pattern matching in Enso;
* the related Pivotal issue: https://www.pivotaltracker.com/story/show/183219169
* <p>TODO once the related issue is fixed, this workaround may be replaced with pattern matching
* in Enso; the related Pivotal issue: https://www.pivotaltracker.com/story/show/183219169
*/
public static TimeUtilsBase utils_for(Value value) {
boolean isDate = value.isDate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ public static Temporal quarter_start(Temporal temporal) {
int month = temporal.get(ChronoField.MONTH_OF_YEAR);
int quarter = (month - 1) / 3;
int firstMonth = quarter * 3 + 1;
return temporal.with(ChronoField.MONTH_OF_YEAR, firstMonth).with(TemporalAdjusters.firstDayOfMonth());
return temporal
.with(ChronoField.MONTH_OF_YEAR, firstMonth)
.with(TemporalAdjusters.firstDayOfMonth());
}

public static Temporal quarter_end(Temporal temporal) {
int month = temporal.get(ChronoField.MONTH_OF_YEAR);
int quarter = (month - 1) / 3;
int lastMonth = quarter * 3 + 3;
return temporal.with(ChronoField.MONTH_OF_YEAR, lastMonth).with(TemporalAdjusters.lastDayOfMonth());
return temporal
.with(ChronoField.MONTH_OF_YEAR, lastMonth)
.with(TemporalAdjusters.lastDayOfMonth());
}
}

0 comments on commit bbd77e1

Please sign in to comment.