* @brief Re-formats an ISO 8601 timestamp in the DB Explorer's display style. */
| 121 | * @brief Re-formats an ISO 8601 timestamp in the DB Explorer's display style. |
| 122 | */ |
| 123 | static QString formatDate(const QString& iso) |
| 124 | { |
| 125 | if (iso.isEmpty()) |
| 126 | // code-verify off |
| 127 | return QStringLiteral("—"); |
| 128 | // code-verify on |
| 129 | |
| 130 | const auto dt = QDateTime::fromString(iso, Qt::ISODate); |
| 131 | if (!dt.isValid()) |
| 132 | return iso; |
| 133 | |
| 134 | // code-verify off |
| 135 | return dt.toString(QStringLiteral("MMM d, yyyy — h:mm:ss AP")); |
| 136 | // code-verify on |
| 137 | } |
| 138 | |
| 139 | //-------------------------------------------------------------------------------------------------- |
| 140 | // Constructor & destructor |
no test coverage detected