mirror of
https://github.com/TangentFoxy/lua-date.git
synced 2025-07-28 11:02:17 +00:00
Prepare for release
This commit is contained in:
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -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.
|
@@ -14,12 +14,15 @@ Lua Date and Time module for Lua 5.x.
|
|||||||
* Lua module (not binary).
|
* Lua module (not binary).
|
||||||
* Formats Date and Time like strftime.
|
* Formats Date and Time like strftime.
|
||||||
|
|
||||||
|
## License
|
||||||
|
[MIT license](http://opensource.org/licenses/MIT).
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
Tests are located in the `spec` directory and can be run using [busted](http://olivinelabs.com/busted/).
|
Tests are located in the `spec` directory and can be run using [busted](http://olivinelabs.com/busted/).
|
||||||
|
|
||||||
##Changes:
|
##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.1 Lua 5.2 support. Global 'date' will no longer be set.
|
||||||
- v2.0 original by Jas Latrix
|
- v2.0 original by Jas Latrix
|
@@ -1,5 +1,5 @@
|
|||||||
package = "date"
|
package = "date"
|
||||||
version = "2.1.0-2"
|
version = "2.1.1-2"
|
||||||
|
|
||||||
description = {
|
description = {
|
||||||
summary = "Date & Time module for Lua 5.x",
|
summary = "Date & Time module for Lua 5.x",
|
||||||
@@ -8,7 +8,7 @@ description = {
|
|||||||
parsing, time addition & subtraction, time span calculation, support for
|
parsing, time addition & subtraction, time span calculation, support for
|
||||||
ISO 8601 Dates, local time support, strftime-like formatting.
|
ISO 8601 Dates, local time support, strftime-like formatting.
|
||||||
]],
|
]],
|
||||||
license = "Public Domain",
|
license = "MIT",
|
||||||
homepage = "https://github.com/Tieske/date",
|
homepage = "https://github.com/Tieske/date",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,8 +17,8 @@ dependencies = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
source = {
|
source = {
|
||||||
url = "https://github.com/Tieske/date/archive/version_2.1.tar.gz",
|
url = "https://github.com/Tieske/date/archive/version_2.1.1.tar.gz",
|
||||||
dir = "date-version_2.1",
|
dir = "date-version_2.1.1",
|
||||||
}
|
}
|
||||||
|
|
||||||
build = {
|
build = {
|
||||||
|
6
date.lua
6
date.lua
@@ -1,9 +1,9 @@
|
|||||||
---------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------
|
||||||
-- Module for date and time calculations
|
-- Module for date and time calculations
|
||||||
--
|
--
|
||||||
-- Version 2.1.0, Copyright (C) 2006, by Jas Latrix (jastejada@yahoo.com)
|
-- Version 2.1.1, 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.
|
|
||||||
-- Copyright (C) 2013 update to Lua 5.2 by Thijs Schreijer
|
-- Copyright (C) 2013 update to Lua 5.2 by Thijs Schreijer
|
||||||
|
-- Licensed under MIT, http://opensource.org/licenses/MIT
|
||||||
|
|
||||||
--[[ CONSTANTS ]]--
|
--[[ CONSTANTS ]]--
|
||||||
local HOURPERDAY = 24
|
local HOURPERDAY = 24
|
||||||
@@ -202,7 +202,7 @@
|
|||||||
local date = {}
|
local date = {}
|
||||||
setmetatable(date, date)
|
setmetatable(date, date)
|
||||||
-- Version: VMMMRRRR; V-Major, M-Minor, R-Revision; e.g. 5.45.321 == 50450321
|
-- 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
|
--#end -- not DATE_OBJECT_AFX
|
||||||
--[[ THE DATE OBJECT ]]--
|
--[[ THE DATE OBJECT ]]--
|
||||||
local dobj = {}
|
local dobj = {}
|
||||||
|
@@ -3866,7 +3866,7 @@ dateObject:<span class="bold"><strong>spanticks</strong></span>()
|
|||||||
a = date(2181, "aPr", 4, 6, 30, 30, 15000)
|
a = date(2181, "aPr", 4, 6, 30, 30, 15000)
|
||||||
b = date(a):adddays(2)
|
b = date(a):adddays(2)
|
||||||
c = date.diff(b, a)
|
c = date.diff(b, a)
|
||||||
assert(c:spanseconds() == (2*24*60*60))
|
assert(c:spanticks() == (2*24*60*60*1000000))
|
||||||
</pre>
|
</pre>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
Reference in New Issue
Block a user