diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6fb308f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) http://opensource.org/licenses/MIT + +Copyright (c) 2013-2014 Thijs Schreijer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 8d9fe09..2b0bbfd 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,15 @@ Lua Date and Time module for Lua 5.x. * Lua module (not binary). * Formats Date and Time like strftime. +## License +[MIT license](http://opensource.org/licenses/MIT). + ## Tests Tests are located in the `spec` directory and can be run using [busted](http://olivinelabs.com/busted/). ##Changes: -- v2.1.1 fix for '>=' operator, initial setup of test suite, added Travis CI +- v2.1.1 fix for '>=' operator, added test suite, added Travis CI, license MIT - v2.1 Lua 5.2 support. Global 'date' will no longer be set. - v2.0 original by Jas Latrix \ No newline at end of file diff --git a/date-2.1.0-2.rockspec b/date-2.1.0-2.rockspec index cb677f3..ae55f32 100644 --- a/date-2.1.0-2.rockspec +++ b/date-2.1.0-2.rockspec @@ -1,5 +1,5 @@ package = "date" -version = "2.1.0-2" +version = "2.1.1-2" description = { summary = "Date & Time module for Lua 5.x", @@ -8,7 +8,7 @@ description = { parsing, time addition & subtraction, time span calculation, support for ISO 8601 Dates, local time support, strftime-like formatting. ]], - license = "Public Domain", + license = "MIT", homepage = "https://github.com/Tieske/date", } @@ -17,8 +17,8 @@ dependencies = { } source = { - url = "https://github.com/Tieske/date/archive/version_2.1.tar.gz", - dir = "date-version_2.1", + url = "https://github.com/Tieske/date/archive/version_2.1.1.tar.gz", + dir = "date-version_2.1.1", } build = { diff --git a/date.lua b/date.lua index c90d8a6..998947b 100644 --- a/date.lua +++ b/date.lua @@ -1,9 +1,9 @@ --------------------------------------------------------------------------------------- -- Module for date and time calculations -- --- Version 2.1.0, Copyright (C) 2006, by Jas Latrix (jastejada@yahoo.com) --- All Rights Deserved. Use this code at your own risk! Keep out of reach of children. +-- Version 2.1.1, Copyright (C) 2006, by Jas Latrix (jastejada@yahoo.com) -- Copyright (C) 2013 update to Lua 5.2 by Thijs Schreijer +-- Licensed under MIT, http://opensource.org/licenses/MIT --[[ CONSTANTS ]]-- local HOURPERDAY = 24 @@ -202,7 +202,7 @@ local date = {} setmetatable(date, date) -- Version: VMMMRRRR; V-Major, M-Minor, R-Revision; e.g. 5.45.321 == 50450321 - date.version = 20010000 -- 2.1.0 + date.version = 20010001 -- 2.1.1 --#end -- not DATE_OBJECT_AFX --[[ THE DATE OBJECT ]]-- local dobj = {} diff --git a/doc/index_cleaned.html b/doc/index_cleaned.html index fc42446..fb0f59b 100644 --- a/doc/index_cleaned.html +++ b/doc/index_cleaned.html @@ -3866,7 +3866,7 @@ dateObject:spanticks() a = date(2181, "aPr", 4, 6, 30, 30, 15000) b = date(a):adddays(2) c = date.diff(b, a) -assert(c:spanseconds() == (2*24*60*60)) +assert(c:spanticks() == (2*24*60*60*1000000))