summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm8
-rw-r--r--templates/history_map.html.ep8
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 4c58c0e..5ecfcc0 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -1745,13 +1745,12 @@ sub map_history {
my $with_polyline = $route_type eq 'beeline' ? 0 : 1;
my $parser = DateTime::Format::Strptime->new(
- pattern => '%d.%m.%Y',
+ pattern => '%F',
locale => 'de_DE',
time_zone => 'Europe/Berlin'
);
- if ( $filter_from
- and $filter_from =~ m{ ^ (\d+) [.] (\d+) [.] (\d+) $ }x )
+ if ( $filter_from )
{
$filter_from = $parser->parse_datetime($filter_from);
}
@@ -1759,8 +1758,7 @@ sub map_history {
$filter_from = undef;
}
- if ( $filter_until
- and $filter_until =~ m{ ^ (\d+) [.] (\d+) [.] (\d+) $ }x )
+ if ( $filter_until )
{
$filter_until = $parser->parse_datetime($filter_until)->set(
hour => 23,
diff --git a/templates/history_map.html.ep b/templates/history_map.html.ep
index c2ff9ed..6620cb2 100644
--- a/templates/history_map.html.ep
+++ b/templates/history_map.html.ep
@@ -88,14 +88,14 @@
</p>
<div class="row">
<div class="input-field col s12">
- %= text_field 'filter_from', id => 'filter_from', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9]( +[0-9][0-9]:[0-9][0-9])?'
- <label for="filter_from">Abfahrt ab (DD.MM.YYYY)</label>
+ %= date_field 'filter_from', id => 'filter_from', class => 'validate'
+ <label for="filter_from" class="active">Abfahrt ab</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
- %= text_field 'filter_to', id => 'filter_to', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9]( +[0-9][0-9]:[0-9][0-9])?'
- <label for="filter_to">Abfahrt bis (DD.MM.YYYY)</label>
+ %= date_field 'filter_to', id => 'filter_to', class => 'validate'
+ <label for="filter_to" class="active">Abfahrt bis</label>
</div>
</div>
<div class="row">