give a more detailed error in this case

This commit is contained in:
Abraham Toriz 2021-07-13 17:53:30 -05:00
parent faef02d0a9
commit 74e9b164c5
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
2 changed files with 28 additions and 2 deletions

View File

@ -126,7 +126,7 @@ It is possible to access directly the sqlite database using
## Specifying times
Some arguments accept a time as value, like `t in`'s `--at` or `t d --start`.
This are the accepted formats:
These are the accepted formats:
**Something similar to ISO format** will be parsed as a time in the computer's
timezone.

View File

@ -27,7 +27,33 @@ pub enum Error {
#[error("Couldn't parse yaml file at: {path}\nwith error: {error}")]
YamlError{ path: PathBuf, error: serde_yaml::Error},
#[error("Could not understand '{0}' as a date format.")]
#[error("Could not understand '{0}' as a date format. Some options are:
Something similar to ISO format will be parsed as a time in the computer's
timezone.
* '2021-01-13' a date
* '2019-05-03 11:13' a date with portions of a time
ISO format with offset or UTC will be parsed as a time in the specified
timezone. Use 'Z' for 'UTC' and an offset for everything else
* '2021-01-13Z'
* '2005-10-14 19:20:35+05:00'
something that looks like an hour will be parsed as a time in the current
day in the computer's timezone. Add 'Z' or an offset to specify the timezone.
* '11:30'
* '23:50:45' (with seconds)
some human times, for now restricted to time ago:
* 'an hour ago'
* 'a minute ago'
* '50 min ago'
* '1h30m ago'
* 'two hours thirty minutes ago'")]
DateTimeParseError(String),
#[error("IOError: {0}")]