mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
DateUtilsTest: Simplify getCalendarUTC
This commit is contained in:
@@ -120,11 +120,10 @@ class DateUtilsTest : BaseUnitTest() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun getWeekdaysInMonth() {
|
fun getWeekdaysInMonth() {
|
||||||
fun getCalendarUTC(year: Int, month: Int, dayOfMonth: Int): GregorianCalendar {
|
fun getCalendarUTC(year: Int, month: Int, dayOfMonth: Int) =
|
||||||
val gregCalendar = GregorianCalendar(year, month, dayOfMonth)
|
GregorianCalendar(year, month, dayOfMonth).apply {
|
||||||
gregCalendar.timeZone = TimeZone.getTimeZone("UTC")
|
timeZone = TimeZone.getTimeZone("UTC")
|
||||||
return gregCalendar
|
}
|
||||||
}
|
|
||||||
|
|
||||||
val february = getCalendarUTC(2018, Calendar.FEBRUARY, 1)
|
val february = getCalendarUTC(2018, Calendar.FEBRUARY, 1)
|
||||||
val leapFebruary = getCalendarUTC(2020, Calendar.FEBRUARY, 1)
|
val leapFebruary = getCalendarUTC(2020, Calendar.FEBRUARY, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user