summaryrefslogtreecommitdiff
path: root/src/core/util.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/util.vala')
-rw-r--r--src/core/util.vala11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/util.vala b/src/core/util.vala
index 9507895..461d2c0 100644
--- a/src/core/util.vala
+++ b/src/core/util.vala
@@ -190,7 +190,12 @@ public bool null_progress_monitor(uint64 count, uint64 total) {
return true;
}
+public static int64 nullsafe_date_time_comperator(DateTime? time_a, DateTime? time_b) {
+ if (time_a == null && time_b == null) return 0;
-double degrees_to_radians(double theta) {
- return (theta * (GLib.Math.PI / 180.0));
-}
+ if (time_a == null && time_b != null) return -1;
+ if (time_a != null && time_b == null) return 1;
+
+ return time_a.compare(time_b);
+
+} \ No newline at end of file