Add support for recurring tasks ("rec:" keyword)

This commit is contained in:
fretep
2017-10-15 20:22:22 +11:00
parent f982b9c581
commit d6256bcfe3
7 changed files with 389 additions and 38 deletions

22
tests/include/setup.vader Normal file
View File

@@ -0,0 +1,22 @@
Execute (Clean up test environment):
Save maplocalleader
let maplocalleader = '\'
function! ReplaceCurrentDates(expected)
if a:expected != ''
execute "silent! %substitute/" . a:expected . "/**EXPECTED**/"
endif
execute "silent! %substitute/" . strftime("%Y-%m-%d") . "/**TODAY**/"
for b:unit in ['D', 'W', 'M', 'Y']
let [s:year, s:month, s:day] = todo#ParseDate(strftime("%Y-%m-%d"))
let [s:year, s:month, s:day] = todo#DateAdd(s:year, s:month, s:day, 2, b:unit)
let s:duedate = printf('%04d', s:year) . '-' . printf('%02d', s:month) . '-' . printf('%02d', s:day)
execute "silent! %substitute/" . s:duedate . "/**TODAY+2" . b:unit . "**/"
endfor
endfunction
Before:
After:
Given: