Commit ef109b09 authored by Rufus's avatar Rufus

Fixes a comment regarding timezone

Fixes a timezone bug: Date only returns UTC time without DST so I applied a dirty workaround by adding an hour
https://stackoverflow.com/questions/1305350/how-to-get-the-current-date-and-time-of-your-timezone-in-java
parent 2367f4b1
......@@ -27,7 +27,7 @@ public class EventsParser extends IterableAbstractPullParser<DetailedEvent> {
private final DateFormat DATE_FORMAT = DateUtils.withAustrianTimeZone(new SimpleDateFormat("yyyy-MM-dd", Locale.US));
// Calendar used to compute the events time, according to Belgium timezone
// Calendar used to compute the events time, according to Austrian timezone
private final Calendar calendar = Calendar.getInstance(DateUtils.getAustriaTimeZone(), Locale.US);
private Day currentDay;
......
......@@ -25,7 +25,7 @@ public class LiveViewModel extends AndroidViewModel {
new Function<Long, LiveData<PagedList<StatusEvent>>>() {
@Override
public LiveData<PagedList<StatusEvent>> apply(Long version) {
final long now = System.currentTimeMillis();
final long now = System.currentTimeMillis() + 3600000;
return new LivePagedListBuilder<>(appDatabase.getScheduleDao().getEventsWithStartTime(now, now + NEXT_EVENTS_INTERVAL), 20)
.build();
}
......@@ -34,7 +34,7 @@ public class LiveViewModel extends AndroidViewModel {
new Function<Long, LiveData<PagedList<StatusEvent>>>() {
@Override
public LiveData<PagedList<StatusEvent>> apply(Long version) {
final long now = System.currentTimeMillis();
final long now = System.currentTimeMillis() + 3600000;
return new LivePagedListBuilder<>(appDatabase.getScheduleDao().getEventsInProgress(now), 20)
.build();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment