diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-08-13 21:09:23 +0200 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-08-13 21:09:23 +0200 |
commit | 152907734c1ba64d39aeed6e7484031ba6794e35 (patch) | |
tree | 9145f197de3caa814c99f501aec65d8b0100eeec | |
parent | 135021898f973475bd62edbe9ddbd382c772c3d3 (diff) |
carriage formation: show timestamp of (possibly cached) result4.29.10
-rw-r--r-- | lib/DBInfoscreen/Controller/Wagenreihung.pm | 1 | ||||
-rw-r--r-- | lib/DBInfoscreen/Helper/Wagonorder.pm | 3 | ||||
-rw-r--r-- | templates/wagenreihung.html.ep | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/lib/DBInfoscreen/Controller/Wagenreihung.pm b/lib/DBInfoscreen/Controller/Wagenreihung.pm index cf7cdd3..a4a0ddc 100644 --- a/lib/DBInfoscreen/Controller/Wagenreihung.pm +++ b/lib/DBInfoscreen/Controller/Wagenreihung.pm @@ -173,6 +173,7 @@ sub wagenreihung { wref => $wref, exit_dir => $exit_dir, hide_opts => 1, + ts => $json->{ts}, ); } )->catch( diff --git a/lib/DBInfoscreen/Helper/Wagonorder.pm b/lib/DBInfoscreen/Helper/Wagonorder.pm index 94eebb1..c736816 100644 --- a/lib/DBInfoscreen/Helper/Wagonorder.pm +++ b/lib/DBInfoscreen/Helper/Wagonorder.pm @@ -8,6 +8,7 @@ use strict; use warnings; use 5.020; +use DateTime; use Mojo::Promise; sub new { @@ -93,6 +94,8 @@ sub get_p { $self->{log}->debug("wagonorder->get_p($url): OK"); my $json = $tx->res->json; + $json->{ts} = DateTime->now( time_zone => 'Europe/Berlin' ) + ->strftime('%d.%m.%Y %H:%M'); $self->{main_cache}->freeze( $url, $json ); $promise->resolve( $json, \%param ); diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index 214d148..3da4257 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -50,7 +50,7 @@ </div> --> <p class="copyright"> - Quelle: DB Wagenreihungs-API. Angaben ohne Gewähr. + Quelle: DB Wagenreihungs-API (<%= stash('ts') // q{} %>). Angaben ohne Gewähr. </p> </div> |