aboutsummaryrefslogtreecommitdiff
path: root/advtrains_line_automation/station_editor.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2026-01-22 20:25:00 +0100
committerorwell <orwell@bleipb.de>2026-01-22 20:25:00 +0100
commit404690b08dca855ef57cde9fba0bd32caf4abef1 (patch)
tree3d0c29f2c12cfea0fe2e0293b9dd9ab565d82e4c /advtrains_line_automation/station_editor.lua
parentd6469df4c73432ca953be9645a7db3626026f117 (diff)
RailwayTime: Extend to hours precision, wrap clock at 7 days, clip repeating times at day boundary
Diffstat (limited to 'advtrains_line_automation/station_editor.lua')
-rw-r--r--advtrains_line_automation/station_editor.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains_line_automation/station_editor.lua b/advtrains_line_automation/station_editor.lua
index e9baaf1..4c247c5 100644
--- a/advtrains_line_automation/station_editor.lua
+++ b/advtrains_line_automation/station_editor.lua
@@ -816,7 +816,7 @@ local function jr_refresh_departure(custom_state)
custom_state.message = ""
return
end
- local rwtime = rwt.to_secs(rwt.get_time())
+ local rwtime = rwt.now()
local prediction = advtrains.lines.predict_station_departures(linevar_def, assert(stop_info.linevar_index), rwtime)
if #prediction == 0 then
custom_state.message = S("No departures for the selected line found in the near future")
@@ -824,7 +824,7 @@ local function jr_refresh_departure(custom_state)
end
local deps = {}
for i, pred in ipairs(prediction) do
- deps[i] = tostring(pred.dep - rwtime)
+ deps[i] = tostring(rwt.diff(rwtime, pred.dep))
end
custom_state.message = S("next departures of the selected line in: ")..table.concat(deps, ", ").." s"
end