use of com.ichi2.libanki.backend.model.SchedTimingToday in project Anki-Android by ankidroid.
the class SchedV2 method _updateCutoff.
/**
* Daily cutoff ************************************************************* **********************************
* This function uses GregorianCalendar so as to be sensitive to leap years, daylight savings, etc.
*/
/* Overriden: other way to count time*/
@RustCleanup("remove timing == null check once JavaBackend is removed")
public void _updateCutoff() {
int oldToday = mToday == null ? 0 : mToday;
SchedTimingToday timing = _timingToday();
if (timing == null) {
mToday = _daysSinceCreation();
mDayCutoff = _dayCutoff();
} else if (_new_timezone_enabled()) {
mToday = timing.days_elapsed();
mDayCutoff = timing.next_day_at();
} else {
mToday = _daysSinceCreation();
mDayCutoff = _dayCutoff();
}
if (oldToday != mToday) {
mCol.log(mToday, mDayCutoff);
}
// instead
for (Deck deck : mCol.getDecks().all()) {
update(deck);
}
// unbury if the day has rolled over
int unburied = mCol.get_config("lastUnburied", 0);
if (unburied < mToday) {
SyncStatus.ignoreDatabaseModification(this::unburyCards);
mCol.set_config("lastUnburied", mToday);
}
}
Aggregations