diff --git a/date.lua b/date.lua index f70b96d..e9f1110 100644 --- a/date.lua +++ b/date.lua @@ -30,7 +30,7 @@ local string = string local math = math local os = os - local unpack = unpack + local unpack = unpack or table.unpack local setmetatable = setmetatable local getmetatable = getmetatable --[[ EXTRA FUNCTIONS ]]-- @@ -198,8 +198,7 @@ --[[ THE DATE MOUDLE ]]-- local fmtstr = "%x %X"; --#if not DATE_OBJECT_AFX then - date = {} - local date = date + local date = {} setmetatable(date, date) -- Version: VMMMRRRR; V-Major, M-Minor, R-Revision; e.g. 5.45.321 == 50450321 date.version = 20000000 -- 2.0.0 diff --git a/doc/date.doc.chm b/doc/date.doc.chm deleted file mode 100644 index 46ade1a..0000000 Binary files a/doc/date.doc.chm and /dev/null differ diff --git a/doc/index.html b/doc/index.html index f4a90f1..84522c4 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,11 +1,11 @@
Table of Contents
- To Load the module call require"date"
in your script.
+ To Load the module call local date = require"date"
in your script.
Make sure Lua can find the source file date.lua
.
- A global table called date
will be created.
+ No global table date
will be created.
Use the metamethod __call to construct a dateObject see example below:
-require "date" +local date = require "date" -- prints all FRIDAY the 13TH dates between year 2000 and 2010 for i = 2000, 2010 do -- year jan 1 diff --git a/samples/mkcalendar.lua b/samples/mkcalendar.lua index 88088e4..ff21e90 100644 --- a/samples/mkcalendar.lua +++ b/samples/mkcalendar.lua @@ -6,7 +6,7 @@ arg: file - the name of the file to write the generated text calendar --]]--------------------- -require"date" +local date = require"date" function makemonth(y,m) local t = {} diff --git a/samples/mkisocal.lua b/samples/mkisocal.lua index 5eb905a..1e48b41 100644 --- a/samples/mkisocal.lua +++ b/samples/mkisocal.lua @@ -6,7 +6,7 @@ arg: file - the name of the file to write the generated text calendar --]]--------------------- -require"date" +local date = require"date" local htm_foot = [[]] local htm_head = [[]]