Editing Module:Sandbox/Valwren

From Fallen London Wiki (Staging)

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 6: Line 6:
 
local function event_start_for_time(time)
 
local function event_start_for_time(time)
 
   local weekday = os.date("%w", time)
 
   local weekday = os.date("%w", time)
 +
  local monday = (4 - weekday) * 86400 + time
 
    
 
    
 
   -- the below does NOT work
 
   -- the below does NOT work
Line 13: Line 14:
 
   --return thursday
 
   --return thursday
 
    
 
    
   -- the below does NOT work
+
   -- this one is threw a lua error
-- if weekday == '1' or weekday == '2' or weekday == '3' or (weekday == '4' and os.date("%H%M", time) < '1200') then
+
  if weekday == '1' or weekday == '2' or weekday == '3' or (weekday == '4' and os.date("%H%M", time) < '1200') then
     --monday = monday - (7 * 86400)
+
     monday = monday - (7 * 86400)
   --end
+
   end
   --return monday
+
   return monday
 
    
 
    
 
   -- the below works correctly
 
   -- the below works correctly
   local thursday = (4 - weekday) * 86400 + time
+
   --local thursday = (4 - weekday) * 86400 + time
thursday = thursday - (7 * 86400)
+
  --thursday = thursday - (7 * 86400)
   return thursday
+
   --return thursday
 
    
 
    
 
end
 
end

Please note that all contributions to Fallen London Wiki (Staging) are considered to be released under the Creative Commons Attribution-ShareAlike (see Fallen London Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)
Preview page with this template

Template used on this page: