~charlesk/indicator-datetime/lp-1431384-add-tag-for-menuitem-icon

« back to all changes in this revision

Viewing changes to src/menu.cpp

Fix bug that prevented clicking on calendar days where DST sprang forward. Fixes: #1429388
Approved by: Ted Gould, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
        const auto now = m_state->clock->localtime();
153
153
        const auto calendar_day = m_state->calendar_month->month().get();
154
154
        if ((profile() == Desktop) && !DateTime::is_same_day(now, calendar_day))
155
 
            begin = calendar_day.add_full (0, 0, 0, -calendar_day.hour(), -calendar_day.minute(), -calendar_day.seconds());
 
155
            begin = calendar_day.start_of_day();
156
156
        else
157
 
            begin = now.add_full (0, 0, 0, 0, 0, -now.seconds());
 
157
            begin = now.start_of_minute();
158
158
 
159
159
        std::vector<Appointment> upcoming;
160
160
        for(const auto& a : m_state->calendar_upcoming->appointments().get())