Custom function to add consecutive dates #349
Replies: 1 comment 1 reply
-
If your most recent week is at the top, then maybe something like this:
local year, month, day, week =
buffer:get_line(1):match('(%d+)%-(%d+)%-(%d+)')
if not year then return end
local lastDate = os.time{year = year, month = month, day = day}
local date = os.date('*t', lastDate)
...
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Mirodin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to leverage a custom function to use a text file as a calendar.txt. Therefore when having the file open in Textadept I would like to open the command prompt (
ctrl+E
) and run i.e.addWeek
.Would become this:
This is what I have so far I am just missing the "find the last date" part.
Thanks in advance :)
Beta Was this translation helpful? Give feedback.
All reactions