def set_completed(self, p_completion_date=date.today()):
        """
        Marks the todo as complete.
        Sets the completed flag and sets the completion date to today.
        """
        if not self.is_completed():
            self.set_priority(None)

            self.fields['completed'] = True
            self.fields['completionDate'] = p_completion_date

            self.src = re.sub(r'^(\([A-Z]\) )?',
                              'x ' + p_completion_date.isoformat() + ' ',
                              self.src)
Marks the todo as complete.
        Sets the completed flag and sets the completion date to today.