| 34 | } |
| 35 | |
| 36 | QString ordinalName(int ordinal) |
| 37 | { |
| 38 | switch (ordinal) { |
| 39 | case 1: return "first"; |
| 40 | case 2: return "second"; |
| 41 | case 3: return "third"; |
| 42 | case 4: return "fourth"; |
| 43 | case 5: return "fifth"; |
| 44 | case -1: return "last"; |
| 45 | default: return {}; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | // Date of the nth `weekday` (Qt 1..7) within `year`/`month`. ordinal>0 counts |
| 50 | // from the start; ordinal==-1 is the last such weekday. Returns a null QDate if |