--- /c/temp/countdown.lua 2011-04-12 21:44:50.000000000 +0200 +++ scripts/countdown.lua 2011-04-13 12:23:12.046250000 +0200 @@ -43,13 +43,23 @@ mins = (diff % (60 * 60)) / 60 secs = diff % 60 - time = string.format("%03i:%02i:%02i:%02i", days, hours, mins, secs) + if (days > 7) then + time = math.ceil(days) + info = "DAYS" + elseif (days <= 7 and days > 1) then + time = string.format("%i %02i", days, hours) + info = "DAYS HOURS" + else + time = string.format("%02i:%02i:%02i", hours, mins, secs) + info = "HOURS MINS SECS " + end else time = "Error" end -- Calculate the difference from now to the target date Rainlendar_SetItemValue(window, "Countdown.time", "text", time) + Rainlendar_SetItemValue(window, "Countdown.info", "text", info) Rainlendar_Redraw(0, window) return True