20.08.2020, 05:17
(This post was last modified: 20.08.2020, 06:27 by benanderson_475.)
How can i create a lua table of the last dates and days for the previous 14 day period, starting at today?
I want to end up with {day 1 = {date = "8/19/2020", day = "wednesday"}, day_two = {date = "7/19/2020", day = "Tuesday"}....... }
i started with
how can i filter out the -ve values and make it circular 0-6 to line up with the %w pattern
I want to end up with {day 1 = {date = "8/19/2020", day = "wednesday"}, day_two = {date = "7/19/2020", day = "Tuesday"}....... }
i started with
Code:
t = os.date("*t")
data ={}
today = os.date('%w') --%w weekday (3) [0-6 = Sunday-Saturday]
Index = 1
for i = 1, 14 do
data[i] = today -Index
Index = Index+1
end