fix #799, properly handle daylight savings at the weekly view
This commit is contained in:
parent
c33990fd66
commit
ccc30c104d
|
@ -104,10 +104,11 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
|
||||||
|
|
||||||
private fun getWeekTimestamps(targetSeconds: Long): List<Long> {
|
private fun getWeekTimestamps(targetSeconds: Long): List<Long> {
|
||||||
val weekTSs = ArrayList<Long>(PREFILLED_WEEKS)
|
val weekTSs = ArrayList<Long>(PREFILLED_WEEKS)
|
||||||
var currWeekTS = targetSeconds - (PREFILLED_WEEKS / 2 * WEEK_SECONDS)
|
val dateTime = Formatter.getDateTimeFromTS(targetSeconds)
|
||||||
|
var currentWeek = dateTime.minusWeeks(PREFILLED_WEEKS / 2)
|
||||||
for (i in 0 until PREFILLED_WEEKS) {
|
for (i in 0 until PREFILLED_WEEKS) {
|
||||||
weekTSs.add(currWeekTS)
|
weekTSs.add(currentWeek.seconds())
|
||||||
currWeekTS += WEEK_SECONDS
|
currentWeek = currentWeek.plusWeeks(1)
|
||||||
}
|
}
|
||||||
return weekTSs
|
return weekTSs
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue