Monday-anchored week index since an epoch, so weekly INTERVAL phase is stable regardless of which weekday is being tested.
| 75 | // Monday-anchored week index since an epoch, so weekly INTERVAL phase is stable |
| 76 | // regardless of which weekday is being tested. |
| 77 | qint64 mondayWeekIndex(const QDate& d) |
| 78 | { |
| 79 | const QDate monday = d.addDays(-(d.dayOfWeek() - 1)); |
| 80 | return monday.toJulianDay() / 7; |
| 81 | } |
| 82 | |
| 83 | // Build a zoned QDateTime for a local wall-clock time, handling a spring-forward |
| 84 | // gap (where that wall time doesn't exist) portably across Qt versions — Qt 6.7's |