Changes

no edit summary
Line 1: Line 1:  
local U = require('Module:Core')
 
local U = require('Module:Core')
 +
 +
local function format_buildtime(minutes)
 +
return U.format{ "${hours:2}:${minutes:2}:${seconds:2}", hours = math.floor(minutes / 60), minutes = minutes % 60, seconds = 0 }
 +
end
    
local ShipList = {}
 
local ShipList = {}
Line 343: Line 347:  
     else
 
     else
 
         constrheader = 'Build Time'
 
         constrheader = 'Build Time'
         if shipInfo["buildtime"] == nil or shipInfo["buildtime"] == "" then
+
         constrdata = type(shipInfo.buildtime) ~= 'table' and '??' or string.format("%s (%s)", format_buildtime(shipInfo.buildtime[1]),
            constrdata = 'Not Buildable'
+
        shipInfo.buildtime[2] and shipInfo.buildtime[3] and 'Normal, LSC' or shipInfo.buildtime[2] and 'Normal' or shipInfo.buildtime[3] and 'LSC' or 'Unbuildable')
        else
  −
            constrdata = shipInfo["buildtime"]
  −
        end
   
     end
 
     end
  
cssedit, gkautomate
7,064

edits