יחידה:אלבום – הבדלי גרסאות

תוכן שנמחק תוכן שנוסף
מאין תקציר עריכה
אין תקציר עריכה
שורה 2:
local PropertyLink = require( "Module:PropertyLink" )
local Date = require('Module:תאריך')
 
function isParsableDuration(value)
return value and type(value) == "string" and string.find(value, "שנייה")
end
 
-- fetch album duration from wikidata and return it in "mm:ss" format
function duration(frame)
local property = frame.args["property"] or "P2047"
local id = frame.args["id"]
local value = PropertyLink.getProperty(property, false, false, id)
if not isParsableDuration(value) then return nil end
local totalSeconds = tonumber(value:gsub(" שנייה", ""):gsub(",", ""), 10)
if not totalSeconds then return nil end
local minutes = math.floor(totalSeconds/60)
local seconds = math.floor(totalSeconds%60)
return string.format("%02d", minutes)..":"..string.format("%02d", seconds)
end
 
--Get year of album based on the album name
שורה 81 ⟵ 100:
 
return {
['כרונולוגיה'] = chronology,
['אורך'] = duration
}