diff --git a/init.lua b/init.lua index 5cf906d..bc79a74 100644 --- a/init.lua +++ b/init.lua @@ -5,7 +5,7 @@ local S = minetest.get_translator('mtimer') -- Set initial global `mtimer` table -- --- The sub-table `show_formspec` is filled programmatically and is used for the +-- The sub-table `dialog` is filled programmatically and is used for the -- functions that show the formspecs to the player. -- -- In sub-table `meta` the meta keys and their default values are defined. Those diff --git a/system/get_times.lua b/system/get_times.lua index 00763cc..8f6bbfa 100644 --- a/system/get_times.lua +++ b/system/get_times.lua @@ -5,7 +5,8 @@ local S = m.translator -- Get translated date names -- -- This helper function takes a table containing a numerical month and a --- numerical day of the week and returns the respecive names. +-- numerical day of the week and returns the respecive names that are ready +-- for being translated. -- -- { day = 1, month = 6 } -> { day = S('Monday'), month = S('May') } -- @@ -32,7 +33,7 @@ end -- Real-world time handling -- --- This function returns the formatted string as well a s the raw format string +-- This function returns the formatted string as well as the raw format string -- and all the replacement values for the variables basing on what time type -- was requested. The types are `real` for the real-world time or `session` -- for the session start time. @@ -58,7 +59,8 @@ end -- month = month of the requested time, -- day = day of the requested time, -- iso8601_date = ISO 8601 date part based on the requested time, --- iso8601_time = ISO 8601 time part based on the requested time +-- iso8601_time = ISO 8601 time part based on the requested time, +-- timestamp = the date’s timestamp -- }, -- format = raw string for formatting the requeste time type, -- formatted = the formatted (all variables replaced) string @@ -157,6 +159,10 @@ end -- thus is only useful to represent the time of the day and nothing -- else like the date or something like that. -- +-- The generated timestamp is then passed to the os.date() default Lua function +-- to parse the human-readable interpretations. Technically this is our own +-- epoch timestamp just being reset after 86400 seconds. +-- -- @param player_name The name of the player to get the time for -- @return table The table as described local get_ingame_time = function (player_name) diff --git a/system/register_globalstep.lua b/system/register_globalstep.lua index 7270769..b5ede93 100644 --- a/system/register_globalstep.lua +++ b/system/register_globalstep.lua @@ -5,7 +5,7 @@ local timer = 0 -- The globalstep iterates over all players every second and updates the timers --- by invoking the `mtimer.update_timer` function that has ben localized to +-- by invoking the `mtimer.update_timer` function that has been localized to -- `update_timer` for faster access. minetest.register_globalstep(function(dtime) timer = timer + dtime;