adding more dayless alarm improvements

This commit is contained in:
tibbi
2020-11-05 11:05:21 +01:00
parent b0c8dfe535
commit 5ac5bf8a0c
5 changed files with 43 additions and 28 deletions

View File

@ -80,19 +80,18 @@ fun formatTime(showSeconds: Boolean, use24HourFormat: Boolean, hours: Int, minut
}
}
fun getTodayBit(): Int {
val calendar = Calendar.getInstance()
val dayOfWeek = (calendar.get(Calendar.DAY_OF_WEEK) + 5) % 7
return 2.0.pow(dayOfWeek).toInt()
}
fun getNextDayBit(): Int {
fun getTomorrowBit(): Int {
val calendar = Calendar.getInstance()
calendar.add(Calendar.DAY_OF_WEEK, 1)
val dayOfWeek = (calendar.get(Calendar.DAY_OF_WEEK) + 5) % 7
return 2.0.pow(dayOfWeek).toInt()
}
fun getCurrentDayMinutes(): Int {
val calendar = Calendar.getInstance()
return calendar.get(Calendar.HOUR_OF_DAY) * 60 + calendar.get(Calendar.MINUTE)
}
fun getAllTimeZones() = arrayListOf(
MyTimeZone(1, "GMT-11:00 Midway", "Pacific/Midway"),
MyTimeZone(2, "GMT-10:00 Honolulu", "Pacific/Honolulu"),