[APIv2/Timetable] Make swipe refresh download timetable for the selected week

This commit is contained in:
Kacper Ziubryniewicz
2019-11-23 21:57:30 +01:00
parent 63960c5e05
commit 6a4994b9c2
6 changed files with 21 additions and 9 deletions

View File

@ -41,6 +41,10 @@ public class Date implements Comparable<Date> {
return new Date(this.year, this.month, this.day);
}
public Date getWeekStart() {
return clone().stepForward(0, 0, -getWeekDay());
}
public static Date fromYmd(String dateTime) {
return new Date(Integer.parseInt(dateTime.substring(0, 4)), Integer.parseInt(dateTime.substring(4, 6)), Integer.parseInt(dateTime.substring(6, 8)));
}