aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/converters.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/converters.h b/lib/converters.h
index d9a68bfb..8ec0fa81 100644
--- a/lib/converters.h
+++ b/lib/converters.h
@@ -146,7 +146,15 @@ struct JsonConverter<QDateTime> {
template <>
struct JsonConverter<QDate> {
- static auto dump(const QDate& val) { return toJson(QDateTime(val)); }
+ static auto dump(const QDate& val) {
+ return toJson(
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ QDateTime(val)
+#else
+ val.startOfDay()
+#endif
+ );
+ }
static auto load(const QJsonValue& jv)
{
return fromJson<QDateTime>(jv).date();