StartAndDueDatesV2

This is a variant of the Start and Due Dates script.

The biggest change is that the script uses only 2 tags to notify you that due or start dates are coming up (duewhen and dowhen). The number of days until/since the due/start date is given in the values of these tags.

The script now also has natural language date processing, so you can write "feb 12" and get a properly formatted date code.

You can view the script here on Gist, or just download it.

Feel free to use and modify as you wish. See the script notes for more information.

Testing the Script

If you want to test the workings of the script, here is a TaskPaper document to help you. It was modified from the example on the Due Script page. Paste this into a new TaskPaper document and then run the script.


   Assigning due dates :
       Items will get a duewhen tag with a value showing how many days left or past (positive = days left, 0 = today, negative = days past)
       - Enter due dates in YYYY-MM-DD format
           - This is due 5/01/08, huge negative number! @due(2008-05-01) 
           - Use today and tomorrow as values.  Script will replace them with actual dates.
               - this is due today @due(today)
               - this is due tomorrow @due(tomorrow)
           - Use natural language dates (month first).
               - this is due on June 15 @due(june 15)
               - caps are fine @due(June 15)
               - you can even use shortened months (3 letter minimum) @due(jun 15)
       - Use same specifiers as repeat tags.  Script will replace them with actual dates.
           - Do this tomorrow @due(day)
           - Do this in 3 days @due(day:3)
           - Do this next wednesday @due(wednesday)
               - Also works with short weekdays @start(wed)
           - Do this next week @due(week)
           - Do this in 2 weeks @due(week:2)
           - Do this next month @due(month)
           - Do this next year @due(year)
       - Error Handling
           - Invalid date @due(5/25)
               - Works, generates error tag
           - No date @due
               - Works, defaults to today
           - Invalid specifier @due(yesterday)
               - Works, generates error tag.
           - Invalid natural language dates
               - Not a real month @due(smarch 15)
                   - Works, generates error tag
               - Too short @due(ma 15)
                   - Works, generates error tag

Assigning start dates : Items will get a duewhen tag with a value showing how many days left or past (positive = days left, 0 = today, negative = days past) - Enter start dates in YYYY-MM-DD format - This starts 5/01/08, huge negative number! @start(2008-05-01) - Use today and tomorrow as values. Script will replace them with actual dates. - this starts today @start(today) - this starts tomorrow @start(tomorrow) - Use natural language dates (month first). - this is due on June 15 @start(june 15) - caps are fine @start(June 15) - you can even use shortened months (3 letter minimum) @start(jun 15) - Use same specifiers as repeat tags. Script will replace them with actual dates. - Start this tomorrow @start(day) - Start this in 3 days @start(day:3) - Start this next wednesday @start(wednesday) - Also works with short weekdays @start(wed) - Start this next week @start(week) - Start this in 2 weeks @start(week:2) - Start this next month @start(month) - Start this next year @start(year) - Error Handling - Invalid date @start(5/25) - Works, generates error tag - No date @start - Works, defaults to today - Invalid specifier @start(yesterday) - Works, generates error tag. - Invalid natural language dates - Not a real month @start(smarch 15) - Works, generates error tag - Too short @start(ma 15) - Works, generates error tag Repeating Items : The repeat tag is only processed if the item is marked done, or does not have a due date assigned. - day - With number, every x days. Example, every 4 days @due(2008-05-21) @repeat(day:4) @done(2008-05-26) - day name - With number, repeat every x day names. Example, every other tuesday @repeat(tuesday:2) @due(2008-05-20) @done(2008-05-26) - Allow abbreviations - Every 2 Mondays @repeat(mon:2) @due(2008-05-25) @done(2008-05-26) - Repeat every Friday starting this Friday @repeat(fri) - Add "-month" to get "of the month". Example, every 3rd thursday of month:@repeat(thursday-month:3) - This one is not implemented yet - week - With number, every x weeks. Example, every other week @due(2008-05-15) @repeat(week:2) @done(2008-05-26) - month - With number, every x months. Example, every six months @due(2008-05-05) @repeat(month:6) @done(2008-05-26) - year - With number, every x years. Example, a year later @due(2008-04-15) @repeat(year:1) @done(2008-05-26) - If no due tag present, add one, calculating from today - Repeat every day, starting tomorrow @repeat(day) - Error Handling - Bad specifier with due date @due(2008-05-21) @repeat(yesterday) @done(2008-05-26) - Works, generates error tag. - Bad specifier @repeat(yesterday) - Mostly works, generates error tag, but also empty due tag. - Bad date with repeat @due(5/25) @repeat(month) - Works, generates error tag.