Fandom Developers Wiki
Register
Advertisement

This module contains testcases for its parent module, Datecalc.

See also[]


-- <nowiki>
-- Unit tests for [[Global Lua Modules/Datecalc]].
-- @see [[Module talk:Datecalc/testcases]]
return {
    main = {
        options = {
            mode   = 'invocation',
            nowiki = false
        },
        tests = {
            {
                'diff|2012/11/20|2012/11/21',
                '-1'
            },
            {
                'diff|1916/09/03|2012/11/21',
                '-35143'
            },
            {
                'diff|2012/11/21|1916/09/03',
                '35143'
            },
            {
                'diff|1916/09/03',
                tostring(require('Dev:Date').diff('1916/09/03', os.date('%Y/%m/%d')):spandays())
            },
            {
                'getday|2015/01/22',
                '22'
            },
            {
                'isleapyear|1916/09/03',
                'true'
            },
            {
                'isleapyear|1913',
                'false'
            },
            {
                'epoch',
                tostring(require('Dev:Date')('jan 1 1970'))
            },
            {
                'adddays|2012/11/20|5',
                'Sun Nov 25 2012 00:00:00'
            }
        }
    }
}
-- </nowiki>
Advertisement