Skip to content

Commit

Permalink
Closes recurring task bug #113.
Browse files Browse the repository at this point in the history
- Recurring tasks with priority and creation date no longer append part of the task's creation date to the new recurring task.
  • Loading branch information
mjdescy committed Aug 9, 2016
1 parent 15a1ea8 commit f7c1003
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions TodoTxtMac/TTMTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ @implementation TTMTask
static NSString * const CompletionDatePattern = @"(?<=^x[ ])((\\d{4})-(\\d{2})-(\\d{2}))(?=[ ]|$)";
static NSString * const PriorityTextPattern = @"^(\\([A-Z]\\)[ ])";
static NSString * const CreationDatePatternIncomplete = @"(?<=^|\\([A-Z]\\)[ ])((\\d{4})-(\\d{2})-(\\d{2}))(?=[ ]|$)";
static NSString * const CreationDatePatternIncompletePlusTrailingSpace = @"(?<=^|\\([A-Z]\\)[ ])((\\d{4})-(\\d{2})-(\\d{2}))([ ]|$)";
static NSString * const CreationDatePatternCompleted = @"(?<=^x[ ]((\\d{4})-(\\d{2})-(\\d{2}))[ ])((\\d{4})-(\\d{2})-(\\d{2}))(?=[ ]|$)";
static NSString * const CreationDatePatternCompletedPlusTrailingSpace = @"(?<=^x[ ]((\\d{4})-(\\d{2})-(\\d{2}))[ ])((\\d{4})-(\\d{2})-(\\d{2}))(?=[ ]|$)";
static NSString * const DueDatePattern = @"(?<=(^|[ ])due:)((\\d{4})-(\\d{2})-(\\d{2}))(?=[ ]|$)";
static NSString * const FullDueDatePatternMiddleOrEnd = @"(([ ])due:)((\\d{4})-(\\d{2})-(\\d{2}))(?=[ ]|$)";
static NSString * const FullDueDatePatternBeginning = @"^due:((\\d{4})-(\\d{2})-(\\d{2}))[ ]?|$";
Expand Down Expand Up @@ -833,9 +835,9 @@ - (void)removeCreationDate {

NSString *newRawText;
if (!self.isCompleted) {
newRawText = [self.rawText substringFromIndex:11];
newRawText = [self.rawText replace:RX(CreationDatePatternIncompletePlusTrailingSpace) with:@""];
} else {
newRawText = [self.rawText replace:RX(CreationDatePatternCompleted) with:@""];
newRawText = [self.rawText replace:RX(CreationDatePatternCompletedPlusTrailingSpace) with:@""];
}
self.rawText = newRawText;
}
Expand Down

0 comments on commit f7c1003

Please sign in to comment.