mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Make Prev/Next buttons skip empty days (3 month limit)
This commit is contained in:
parent
334879114d
commit
d31193de1e
25
daily.cpp
25
daily.cpp
@ -856,12 +856,33 @@ void Daily::on_JournalNotesUnderline_clicked()
|
|||||||
|
|
||||||
void Daily::on_prevDayButton_clicked()
|
void Daily::on_prevDayButton_clicked()
|
||||||
{
|
{
|
||||||
LoadDate(previous_date.addDays(-1));
|
QDate d=previous_date;
|
||||||
|
bool found=false;
|
||||||
|
for (int i=0;i<90;i++) {
|
||||||
|
d=d.addDays(-1);
|
||||||
|
if (PROFILE.GetDay(d)) {
|
||||||
|
LoadDate(d);
|
||||||
|
found=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) LoadDate(previous_date.addDays(-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Daily::on_nextDayButton_clicked()
|
void Daily::on_nextDayButton_clicked()
|
||||||
{
|
{
|
||||||
LoadDate(previous_date.addDays(1));
|
QDate d=previous_date;
|
||||||
|
bool found=false;
|
||||||
|
for (int i=0;i<90;i++) {
|
||||||
|
d=d.addDays(1);
|
||||||
|
if (PROFILE.GetDay(d)) {
|
||||||
|
LoadDate(d);
|
||||||
|
found=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) LoadDate(previous_date.addDays(1));
|
||||||
|
//LoadDate(previous_date.addDays(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Daily::on_calButton_toggled(bool checked)
|
void Daily::on_calButton_toggled(bool checked)
|
||||||
|
Loading…
Reference in New Issue
Block a user