From bffd9a2ef7b132c2e0d394f3794605870236812c Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 5 Jan 2024 01:27:09 +0100 Subject: train input: support " (DD.MM.[YYYY])" and " @ DD.MM.[YYYY]" qualifiers --- lib/DBInfoscreen/Controller/Stationboard.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 11f499b..9c09431 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1960,7 +1960,13 @@ sub redirect_to_station { } } - if ( $input =~ m{ ^ [a-zA-Z]{1,5} \s+ \d+ $ }x ) { + if ( $input =~ m{ ^ [a-zA-Z]{1,5} \s+ \d+ }x ) { + if ( $input =~ s{ \s* @ \s* (? [0-9.]+) $ }{}x ) { + $params->param( date => $+{date} ); + } + elsif ( $input =~ s{ \s* [(] \s* (? [0-9.]+) \s* [)] $ }{}x ) { + $params->param( date => $+{date} ); + } $params = $params->to_string; $self->redirect_to("/z/${input}?${params}"); } -- cgit v1.2.3