Skip to content

Commit

Permalink
docs: Improve docs on finding invalid dates (#1263)
Browse files Browse the repository at this point in the history
* docs: Add more information on validating task dates

* docs: Add 'Finding mistakes in dates' section to dates.md
  • Loading branch information
claremacrae authored Oct 26, 2022
1 parent b34d7b1 commit ac41487
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/getting-started/dates.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,10 @@ Such filter could be:
starts before tomorrow
```
````

## Finding mistakes in dates

Tasks does not automatically report any problem tasks that have invalid dates, such as on the 32nd day of a month. These task will silently not be found by date-based searches.

However, it is possible to search for any tasks with invalid dates in your vault: see
[Finding Tasks with Invalid Dates]({{ site.baseurl }}{% link queries/filters.md %}#finding-tasks-with-invalid-dates).
18 changes: 15 additions & 3 deletions docs/queries/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,30 @@ Use `next tuesday` instead if you mean "next tuesday".

When the day changes, relative dates like `due today` are re-evaluated so that the list stays up-to-date.

### Validating dates
### Finding Tasks with Invalid Dates

> Validation of dates was introduced in Tasks 1.16.0.
It is possible to accidentally use a non-existent date on a task signifier, such as `📅 2022-02-30`. February has at most 29 days.

Such tasks look like they have a date, but that date will never be found. When viewed in Reading mode, they will be shown as:
Such tasks look like they have a date, but that date will never be found. When viewed in Reading mode, the date will be shown as `Invalid date`.

Any such mistakes can be found systematically with:
Any such mistakes can be found systematically with this search:

```tasks
(done date is invalid) OR (due date is invalid) OR (scheduled date is invalid) OR (start date is invalid)
```

<div class="code-example" markdown="1">
Warning
{: .label .label-yellow }
If the above search finds any tasks with invalid dates, they are best fixed by clicking on the backlink to navigate
to the incorrect line, and fixing it by directly typing in the new date.

If you use the 'Create or edit Task' Modal, it will discard the broken date, and there will be no information about
the original, incorrect value.
</div>

---

## Matching multiple filters
Expand Down

0 comments on commit ac41487

Please sign in to comment.