Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Sep 11, 2022
1 parent 918b1f4 commit 39828dc
Showing 1 changed file with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@

public class Date_Period_Utils implements TimeUtilsBase {

public static TemporalAdjuster quarter_start = (Temporal temporal) -> {
int currentQuarter = temporal.get(IsoFields.QUARTER_OF_YEAR);
int month = (currentQuarter - 1) * 3 + 1;
return temporal.with(ChronoField.MONTH_OF_YEAR, month).with(TemporalAdjusters.firstDayOfMonth());
};
public static TemporalAdjuster quarter_start =
(Temporal temporal) -> {
int currentQuarter = temporal.get(IsoFields.QUARTER_OF_YEAR);
int month = (currentQuarter - 1) * 3 + 1;
return temporal
.with(ChronoField.MONTH_OF_YEAR, month)
.with(TemporalAdjusters.firstDayOfMonth());
};

public static TemporalAdjuster quarter_end = (Temporal temporal) -> {
int currentQuarter = YearMonth.from(temporal).get(IsoFields.QUARTER_OF_YEAR);
int month = (currentQuarter - 1) * 3 + 3;
return temporal.with(ChronoField.MONTH_OF_YEAR, month).with(TemporalAdjusters.lastDayOfMonth());
};
public static TemporalAdjuster quarter_end =
(Temporal temporal) -> {
int currentQuarter = YearMonth.from(temporal).get(IsoFields.QUARTER_OF_YEAR);
int month = (currentQuarter - 1) * 3 + 3;
return temporal
.with(ChronoField.MONTH_OF_YEAR, month)
.with(TemporalAdjusters.lastDayOfMonth());
};
}

0 comments on commit 39828dc

Please sign in to comment.