function eta (time)
local hours, mins, tod
local hour = time.hour
local min = time.min
local half_table = {L "second", L "third", L "fourth", L "fifth", L "sixth", L "seventh", L "eighth", L "Ninth", L "tenth", L "the eleventh", L "twelfth", L "first"}
local replace_mins = {
{L "1 minute", L "one minute"}
{L "2 minutes", L "two minutes"}
{L "3 minutes", L "3 minutes"}
{L "4 minutes", L "4 minutes"}
{L "1 |", L "-a 0"}
{L "2 |", L "0-two"}
{L "|", L ""},} if hour <6 then tod = L "in the night"
elseif hour <10 then tod = L "in the morning"
elseif hour <18 then tod = L "in the day"
elseif hour 12 then hour = hour - 12 end if hour == 1 then hours = L "h"
elseif hour <5 then hours = towstring (hour) .. (min <10 and L "hours" or L "")
else hours = towstring (hour) .. (min 20 and L "|" or L "")
end
if # mins == 2 then mins = wstring.gsub (mins, L "-", L "and") .. L "minutes"
end
mins = transform_and_format (mins, replace_mins)
return L "Arrival" .. tod .. hours .. mins .. L "."
end
Bookmarks