From d0aaad443a88968dc61172c050084d3d9faa7602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 12 Aug 2023 10:07:35 +0200 Subject: New upstream version 0.32.2 --- src/core/util.vala | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/util.vala') 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 -- cgit v1.2.3