]> 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:

src/timetable: Invent timetable object
authordaurnimator <quae@daurnimator.com>
Tue, 23 Jul 2013 22:43:20 +0000 (18:43 -0400)
committerdaurnimator <quae@daurnimator.com>
Tue, 23 Jul 2013 22:48:59 +0000 (18:48 -0400)
src/timetable.lua

index 81fcbf8acd6ff9e75ff5c3fad70732c916e9a80f..df78b1570446f4de25aaf0e1d715a4fdeca95418 100644 (file)
@@ -111,8 +111,29 @@ local function normalise ( tm )
 
        return tm
 end
+local timetable_mt = {
+}
+
+local function cast_timetable ( tm )
+       return setmetatable ( tm , timetable_mt )
+end
+
+local function new_timetable ( year , month , day , hour , min , sec )
+       return cast_timetable {
+               year  = year ;
+               month = month ;
+               day   = day ;
+               hour  = hour ;
+               min   = min ;
+               sec   = sec ;
+       }
+end
 
 return {
        doomsday  = doomsday ;
        normalise = normalise ;
+
+       new = new_timetable ;
+       cast = cast_timetable ;
+       timetable_mt = timetable_mt ;
 }