summaryrefslogtreecommitdiff
path: root/src/core/util.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-08-17 17:10:12 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-08-17 17:10:12 +0200
commit008bc99860fd353a5da5d06e6be5937f4a358aed (patch)
treed50b38f704b90b83895a21fd610bcf78c31b2cc9 /src/core/util.vala
parent4ec8ba6ace7234ddc24a7d362a34d9055a83812c (diff)
parent7eef6a59ba38582bed5d459974211eb1f53e1f5d (diff)
Merge branch 'release/debian/0.32.2-1'debian/0.32.2-1
Diffstat (limited to 'src/core/util.vala')
-rw-r--r--src/core/util.vala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/util.vala b/src/core/util.vala
index 461d2c0..8e0f92f 100644
--- a/src/core/util.vala
+++ b/src/core/util.vala
@@ -198,4 +198,15 @@ public static int64 nullsafe_date_time_comperator(DateTime? time_a, DateTime? ti
return time_a.compare(time_b);
+}
+
+/*
+ * Drop microseconds from input DateTime
+ */
+public DateTime? coarsify_date_time(DateTime? dt) {
+ if (dt == null) {
+ return null;
+ }
+
+ return dt.add(-dt.get_microsecond());
} \ No newline at end of file