Changes

Fix build time
Line 1: Line 1:  +
local format = require("Module:StringInterpolation").format
 +
 
local BaseData = require("Module:BaseData")
 
local BaseData = require("Module:BaseData")
 
local ShipData = BaseData()
 
local ShipData = BaseData()
Line 162: Line 164:  
return self._build_time
 
return self._build_time
 
elseif self._build_time then
 
elseif self._build_time then
return os.date(self._build_time * 60)
+
return format("${hours:2}:${minutes:2}:${seconds:2}", self:format_time(self._build_time * 60))
 
else
 
else
 
return "??"
 
return "??"
Line 287: Line 289:  
[20] = "Submarine Tender",
 
[20] = "Submarine Tender",
 
})
 
})
 +
 +
function ShipData:format_time(seconds)
 +
return {
 +
hours = math.floor(seconds / 3600),
 +
minutes = math.floor(seconds / 60) % 60,
 +
seconds = seconds % 60,
 +
}
 +
end
    
function ShipData:create(ship)
 
function ShipData:create(ship)
Anonymous user