From: daurnimator Date: Fri, 30 Aug 2013 18:28:10 +0000 (-0400) Subject: src/timetable: Add clone method X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/7bc6005f0878a5a881c083dc7acecb964b034e1a src/timetable: Add clone method --- diff --git a/src/timetable.lua b/src/timetable.lua index a5d0cc7..8801623 100644 --- a/src/timetable.lua +++ b/src/timetable.lua @@ -179,6 +179,10 @@ local function new_timetable ( year , month , day , hour , min , sec , yday , wd } end +function timetable_methods:clone ( ) + return new_timetable ( unpack_tm ( self ) ) +end + local function new_from_timestamp ( ts ) return new_timetable ( 1970 , 1 , 1 , 0 , 0 , ts ) end