diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-08-12 10:07:35 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-08-12 10:07:35 +0200 |
commit | d0aaad443a88968dc61172c050084d3d9faa7602 (patch) | |
tree | ba9356dd1659416b3217c19bbebda413b8786021 /src/core | |
parent | d443a3c2509889533ca812c163056bace396b586 (diff) |
New upstream version 0.32.2upstream/0.32.2
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/util.vala | 11 |
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 |