--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureBean.java 2009/09/12 12:33:24 320 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureBean.java 2009/09/13 20:17:32 321 @@ -65,10 +65,20 @@ int time1 = Integer.parseInt(time.replace(":", "")); int time2 = Integer.parseInt(otherBean.time.replace(":", "")); - if (time1 > time2) - return 1; - else - return -1; + + //work correctly when clock wraps around at midnight + if (Math.abs(time1-time2) < 1200) { + if (time1 > time2) + return 1; + else + return -1; + } else { + if (time1 < time2) + return 1; + else + return -1; + + } } @@ -80,7 +90,7 @@ updStr = "< 3 min"; break; case 2: - updStr = "< 3 min"; + updStr = "3-10 min"; break; case 3: updStr = "> 10 min";