added modified date to experimental js feature

This commit is contained in:
Rudis Muiznieks 2021-06-23 09:39:00 -05:00
parent 81fbd37eea
commit 952f5499f9
1 changed files with 8 additions and 1 deletions

View File

@ -539,7 +539,14 @@ EOF
my $escapedPlan = encode_entities($plan->{'plan'});
$escapedPlan =~ s/\n/<br>/g;
$escapedPlan =~ s/(<br>)*$//;
my $body = "document.getElementById('dotplan').innerHTML = '$escapedPlan';";
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($mtime);
$year += 1900;
$mon++;
my $fmtMtime = sprintf('%d-%02d-%02d', $year, $mon, $mday);
my $body = <<EOF;
document.getElementById('dotplan_date').innerHTML = '$fmtMtime';
document.getElementById('dotplan_plan').innerHTML = '$escapedPlan';
EOF
my $headers = {
'Content-Type' => 'application/javascript',
'Last-Modified' => HTTP::Date::time2str($mtime)