Skip to content

Commit

Permalink
DateUtilsTest: Simplify getCalendarUTC
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Apr 5, 2024
1 parent 2024277 commit 7f62481
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,10 @@ class DateUtilsTest : BaseUnitTest() {

@Test
fun getWeekdaysInMonth() {
fun getCalendarUTC(year: Int, month: Int, dayOfMonth: Int): GregorianCalendar {
val gregCalendar = GregorianCalendar(year, month, dayOfMonth)
gregCalendar.timeZone = TimeZone.getTimeZone("UTC")
return gregCalendar
}
fun getCalendarUTC(year: Int, month: Int, dayOfMonth: Int) =
GregorianCalendar(year, month, dayOfMonth).apply {
timeZone = TimeZone.getTimeZone("UTC")
}

val february = getCalendarUTC(2018, Calendar.FEBRUARY, 1)
val leapFebruary = getCalendarUTC(2020, Calendar.FEBRUARY, 1)
Expand Down

0 comments on commit 7f62481

Please sign in to comment.