mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
refactor
This commit is contained in:
parent
4a3b19bba6
commit
90b06df30f
1 changed files with 6 additions and 6 deletions
|
@ -160,12 +160,12 @@ fn named_date<Tz: TimeZone>(
|
||||||
"today" => Ok((remaining, local_today)),
|
"today" => Ok((remaining, local_today)),
|
||||||
"tomorrow" => Ok((remaining, local_today + Duration::days(1))),
|
"tomorrow" => Ok((remaining, local_today + Duration::days(1))),
|
||||||
// TODO: lots more!
|
// TODO: lots more!
|
||||||
"eod"=>Ok((remaining,local_today+Duration::days(1))),
|
"eod" => Ok((remaining,local_today+Duration::days(1))),
|
||||||
"sod"=>Ok((remaining,local_today)),
|
"sod" => Ok((remaining,local_today)),
|
||||||
"eow"=> Ok((remaining,local_today+Duration::days((6-day_index).into()))),
|
"eow" => Ok((remaining,local_today+Duration::days((6-day_index).into()))),
|
||||||
"eoww"=>Ok((remaining,local_today+Duration::days((5-day_index).into()))),
|
"eoww" => Ok((remaining,local_today+Duration::days((5-day_index).into()))),
|
||||||
"sow"=>Ok((remaining,local_today+Duration::days((6-day_index).into()))),
|
"sow" => Ok((remaining,local_today+Duration::days((6-day_index).into()))),
|
||||||
"soww"=>Ok((remaining,local_today+Duration::days((7-day_index).into()))),
|
"soww" => Ok((remaining,local_today+Duration::days((7-day_index).into()))),
|
||||||
_ => Err(Err::Error(Error::new(input, ErrorKind::Tag))),
|
_ => Err(Err::Error(Error::new(input, ErrorKind::Tag))),
|
||||||
}
|
}
|
||||||
.map(|(rem, dt)| (rem, dt.and_hms(0, 0, 0).with_timezone(&Utc)))
|
.map(|(rem, dt)| (rem, dt.and_hms(0, 0, 0).with_timezone(&Utc)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue