Closed Piscean closed 9 years ago
@Piscean Good catch. I would never write a due date at the start of a task, so I didn't consider coding for that situation. I'm issuing a patch to fix it.
I'll grab the latest and try it out tomorrow.
The reason I do the due date at the start is because my phone todotxt app is limited in what it can do. Sorting is the only way to tell what I need to do today, so all my tasks start with "due:2014-xx-xx", which means today's tasks are at the top of the list on the phone.
The functionality I was adding to the windows version is "Postpone to Tuesday" instead of Postpone 2 days. I have it all coded and working once these two bugs are fixed. I should be able to check in Monday or Tuesday, assuming all goes well with my testing.
Around line 916 in MainWindowViewModel.cs, private Task SetTaskDueDate(Task task, dynamic newDueDate) { Regex rgx = new Regex(@"(?<=\sdue:)(?(\d{4})-(\d{2})-(\d{2}))");
string oldDueDateText = rgx.Match(task.Raw).Groups["date"].Value.Trim();
If you call this with a task like "due:2014-11-20 Whatever text" and attempt to set the new due date to 2014-11-22, it returns this: ""due:2014-11-20 Whatever text due:2014-11-22"
The rgx expression is broken, so it's not finding a match, and then appending the new due date to the end of the string.
Sadly, the regex logic is beyond me to untangle.