[rygel] core: Properly sort on dates without time



commit dacf2cad6a882b2f8f990d7aed3cd2cd5b7aefdb
Author: Jens Georg <mail jensge org>
Date:   Fri May 27 10:05:38 2011 +0200

    core: Properly sort on dates without time
    
    The implementation in glib was returning an empty timeval if there was
    no time attached to the date

 src/rygel/rygel-media-item.vala |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala
index dbf6417..9561b05 100644
--- a/src/rygel/rygel-media-item.vala
+++ b/src/rygel/rygel-media-item.vala
@@ -290,6 +290,17 @@ public abstract class Rygel.MediaItem : MediaObject {
         } else if (item.date == null) {
             return 1;
         } else {
+            var our_date = this.date;
+            var other_date = item.date;
+
+            if (!our_date.contains ("T")) {
+                our_date += "T00:00:00Z";
+            }
+
+            if (!other_date.contains ("T")) {
+                other_date += "T00:00:00Z";
+            }
+
             var tv1 = TimeVal ();
             assert (tv1.from_iso8601 (this.date));
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]