give a more detailed error in this case
This commit is contained in:
parent
faef02d0a9
commit
74e9b164c5
|
@ -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.
|
||||
|
|
28
src/error.rs
28
src/error.rs
|
@ -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}")]
|
||||
|
|
Loading…
Reference in New Issue