]> git.madduck.net Git - etc/awesome.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Breaking change: Normalise inside of `new_from_timestamp()`
authordaurnimator <quae@daurnimator.com>
Fri, 29 Aug 2014 20:36:10 +0000 (16:36 -0400)
committerdaurnimator <quae@daurnimator.com>
Fri, 29 Aug 2014 20:37:06 +0000 (16:37 -0400)
doc/timetable.md
examples/date_arithmetic.lua
examples/os_date.lua
luatz/init.lua
luatz/timetable.lua

index e3601a4cd1bf11c92b83379b7ea165273d159e18..92c430297850967daa1c9ac9d78018c0d66e8b9e 100644 (file)
@@ -28,12 +28,9 @@ Returns a new timetable with the given contents.
 
 ## `new_from_timestamp ( timestamp )`
 
-Returns a new timetable given a timestamp in seconds since the unix epoch of 
+Returns a new (normalised) timetable, given a timestamp in seconds since the unix epoch of 
 1970-01-01.
 
-`:normalise ( )` should probably be called before use to resolve to the current time and 
-date.
-
 
 ## `:clone ( )`
 
index 3b1126d57b2095d5fbf364509cf470e8091e7863..d5bd92bcfd7723fd749688c60dd1b8fa37a76bd2 100644 (file)
@@ -2,7 +2,7 @@ local luatz = require "luatz"
 
 -- We do this a few times ==> Convert a timestamp to timetable and normalise
 local function ts2tt ( ts )
-       return luatz.timetable.new_from_timestamp ( ts ):normalise ( )
+       return luatz.timetable.new_from_timestamp ( ts )
 end
 
 -- Get the current time in UTC
index 0164780f7e3c3bfa02fe630c97622b5b4b9e5814..deac08b9ed34af5abf49df0b293ed452a595e4ef 100644 (file)
@@ -14,7 +14,7 @@ local function os_date ( format_string , timestamp )
        else -- Localtime
                timestamp = get_tz ( ):localise ( timestamp )
        end
-       local tt = new_from_timestamp ( timestamp ):normalise ( )
+       local tt = new_from_timestamp ( timestamp )
        if format_string == "*t" then
                return tt
        else
index 8ab7cfcc87acd1f54422524a67b521e5f7a05b6a..923e4d6047fc1273b6b2614aaf5dac2b738a026e 100644 (file)
@@ -20,7 +20,7 @@ end
 --- C-like functions
 
 _M.gmtime = function ( ts )
-       return _M.timetable.new_from_timestamp ( ts ):normalise ( )
+       return _M.timetable.new_from_timestamp ( ts )
 end
 
 _M.localtime = function ( ts )
index 3e802428310822aae1162df923aede765174f094..fc89fcaec5c7271d6756ed4c3ff0429e01ff7280 100644 (file)
@@ -227,7 +227,7 @@ local function new_from_timestamp ( ts )
        if type ( ts ) ~= "number" then
                error ( "bad argument #1 to 'new_from_timestamp' (number expected, got " .. type ( ts ) .. ")" , 2 )
        end
-       return new_timetable ( 1970 , 1 , 1 , 0 , 0 , ts )
+       return new_timetable ( 1970 , 1 , 1 , 0 , 0 , ts ):normalise ( )
 end
 
 return {