From 7bc003924c778e453265492e63674b7334384374 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 6 Apr 2018 21:59:13 +0200 Subject: Support date shortcut 'tomorrow' Useful for everyone who doesn't remember the current date --- bin/efa | 2 +- lib/Travel/Routing/DE/EFA.pm | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/efa b/bin/efa index 44fa754..c9527fe 100755 --- a/bin/efa +++ b/bin/efa @@ -521,7 +521,7 @@ route has bike support. =item B<-d>|B<--date> I
.I.[I] -Journey date +Journey date. Also accepts the shortcut B. =item B<-D>|B<--discover> diff --git a/lib/Travel/Routing/DE/EFA.pm b/lib/Travel/Routing/DE/EFA.pm index 021a691..e5173ba 100644 --- a/lib/Travel/Routing/DE/EFA.pm +++ b/lib/Travel/Routing/DE/EFA.pm @@ -93,6 +93,13 @@ sub date { my ( $day, $month, $year ) = split( /[.]/, $date ); + if ( $date eq 'tomorrow' ) { + ( undef, undef, undef, $day, $month, $year ) + = localtime( time + 86400 ); + $month += 1; + $year += 1900; + } + if ( not( defined $day and length($day) @@ -1079,7 +1086,7 @@ Journey start time. Default: now =item B => I[I] -Journey date. Default: today +Journey date. Also accepts the string B. Default: today =item B => \@exclude -- cgit v1.2.3