Turn lift date and time strings into struct Time
[beifahrer] / src / lift-list-window.vala
index 3cacf10..f932a7b 100644 (file)
@@ -115,8 +115,11 @@ public class LiftListWindow : StackableWindow {
                                icon_name = "beifahrer_smoker";
                        else if (LiftFlags.NON_SMOKER in lift.flags)
                                icon_name = "beifahrer_non_smoker";
+                       string datetime = "%02d.%02d.%04d".printf (lift.time.day, lift.time.month, lift.time.year);
+                       if (lift.time.hour >= 0)
+                               datetime += ", %d:%02d".printf (lift.time.hour, lift.time.minute);
                        store.insert_with_values (out iter, -1, 0, lift.city_from + " - " + lift.city_to,
-                                                               1, (lift.time != null) ? (lift.date + ", " + lift.time) : lift.date,
+                                                               1, datetime,
                                                                2, _("%d pl.").printf (lift.places),
                                                                3, lift.price,
                                                                4, icon_name,