diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-08-12 10:08:29 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-08-12 10:08:29 +0200 |
commit | f87eb3c1043d3f4f8e22ba505cd1a827241e160c (patch) | |
tree | e46351c8ec622c9d13232cf00c8a1048e55184af /src/core | |
parent | 7f667adb7b8d3a803a6cd6120dcea4ba4ff89075 (diff) | |
parent | 2333d2b06d52754a55a747fa438844286f98d53a (diff) |
Merge branch 'feature/upstream' into develop
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 |