FANDOM


local data = {
    {
        preseason = 1,
        name = 'Pierwszy przed-sezon',
        start = {2009, 11, 20},
    },
    {
        season = 1,
        name = 'Sezon Pierwszy',
        start = {2010, 7, 14},
    },
 
    {
        preseason = 2,
        name = 'Drugi przed-sezon',
        start = {2011, 9, 20},
    },
    {
        season = 2,
        name = 'Sezon Drugi',
        start = {2011, 11, 29},
    },
 
    {
        preseason = 3,
        name = 'Trzeci przed-sezon',
        start = {2012, 11, 20},
    },
    {
        season = 3,
        name = 'Sezon Trzeci',
        start = {2013, 2, 5},
    },
 
    {
        preseason = 4,
        name = 'Czwarty przed-sezon',
        start = {2013, 11, 26},
    },
    {
        season = 4,
        name = 'Sezon 2014',
        start = {2014, 1, 21},
    },
 
    {
        preseason = 5,
        name = 'Przed-sezon 2015',
        start = {2014, 11, 25},
    },
    {
        season = 5,
        name = 'Sezon 2015',
        start = {2015, 1, 20},
    },
 
    {
        preseason = 6,
        name = 'Przed-sezon 2016',
        start = {2015, 11, 17},
    },
    {
        season = 6,
        name = 'Sezon 2016',
        start = {2016, 1, 19},
    },
 
    {
        preseason = 7,
        name = 'Przed-sezon 2017',
        start = {2016, 11, 8},
    },
    {
        season = 7,
        name = 'Sezon 2017',
        start = {2016, 12, 6},
    },
 
    {
        preseason = 8,
        name = 'Przed-sezon 2018',
        start = {2017, 11, 7},
    },
    {
        season = 8,
        name = 'Sezon 2018',
        start = {2018, 1, 16},
    },
 
    {
        preseason = 9,
        name = 'Przed-sezon 2019',
        start = {2018, 11, 13},
    },
    {
        season = 9,
        name = 'Sezon 2019',
        start = {2019, 1, 22},
    },
 
    {
        preseason = 10,
        name = 'Przed-sezon 2020',
        start = {2019, 11, 19},
    },
    {   season = 10,
        name = 'Sezon 2020',
        start = {2020, 1, 10},
    },
}
 
-- Ta funkcja przerobi tablice w 'start' na timestampy i doda wartość 'end' do wszystkich poza ostatnim
function prep(data)
    for i,v in ipairs(data) do
        data[i]['start'] = os.time{ year = data[i]['start'][1], month = data[i]['start'][2], day = data[i]['start'][3], hour = 0}
        if i > 1 then
            data[i-1]['end'] = data[i]['start'] - 1
        end
    end
    return data
end
 
return prep(data)
Treści społeczności są dostępne na podstawie licencji CC-BY-SA , o ile nie zaznaczono inaczej.