From: daurnimator Date: Wed, 24 Jul 2013 15:56:07 +0000 (-0400) Subject: src/timetable: Add new_from_timestamp function X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/3abaaf68b0945784e3a8968a733bd7f569e4330e?hp=a809e6fc8a079b8db520aebdb5567d7cf55c1559 src/timetable: Add new_from_timestamp function --- diff --git a/src/timetable.lua b/src/timetable.lua index 882d8fd..887ee94 100644 --- a/src/timetable.lua +++ b/src/timetable.lua @@ -173,12 +173,17 @@ local function new_timetable ( year , month , day , hour , min , sec ) } end +local function new_from_timestamp ( ts ) + return new_timetable ( 1970 , 1 , 1 , 0 , 0 , ts ) +end + return { doomsday = doomsday ; normalise = normalise ; timestamp = timestamp ; new = new_timetable ; + new_from_timestamp = new_from_timestamp ; cast = cast_timetable ; timetable_mt = timetable_mt ; }