Friendly one-line preview of the next firing, e.g. "Next: Tue Jun 23, 8:00 PM CDT" — used in the editor and the table.
| 47 | // Friendly one-line preview of the next firing, e.g. |
| 48 | // "Next: Tue Jun 23, 8:00 PM CDT" — used in the editor and the table. |
| 49 | QString formatNext(const NetEntry& entry) |
| 50 | { |
| 51 | const QDateTime occ = NetRecurrence::nextOccurrence(entry, QDateTime::currentDateTimeUtc()); |
| 52 | if (!occ.isValid()) |
| 53 | return QStringLiteral("No upcoming dates"); |
| 54 | const QString when = occ.toString("ddd MMM d, h:mm AP"); |
| 55 | const QString abbr = occ.timeZoneAbbreviation(); |
| 56 | return abbr.isEmpty() ? when : QString("%1 %2").arg(when, abbr); |
| 57 | } |
| 58 | |
| 59 | // --- editor ------------------------------------------------------------- |
| 60 | // |
no test coverage detected