[Remind-Fans] rem2html not highlighting today
hymie at nasalinux.net
hymie at nasalinux.net
Tue Feb 8 13:25:37 EST 2022
Dianne Skoll via Remind-fans writes:
>On Tue, 08 Feb 2022 12:53:54 -0500
> # Highlight today in HTML calendar
> REM [realtoday()] SPECIAL HTMLCLASS rem-today
>
>and it will do what it used to do. I'll update the man page to
>reflect that.
Before you do that ... will this patch work? It worked for me, but
I haven't tested it extensively.
--hymie!
--- /usr/local/bin/rem2html.3.4.b 2022-02-08 12:54:17.906953110 -0500
+++ /usr/local/bin/rem2html 2022-02-08 13:23:23.713519553 -0500
@@ -8,6 +8,8 @@
my %Options;
+my @today;
+
my $rem2html_version = '2.1';
my($days, $shades, $moons, $classes, $Month, $Year, $Numdays, $Firstwkday, $Mondayfirst, $weeks,
@@ -553,6 +555,8 @@
my $class;
if ($Options{nostyle}) {
$class = $classes->[$day] || '';
+ } elsif ($Year eq $today[2] && $Month eq $today[1] && $day == $today[0] ) {
+ $class = $classes->[$day] || "rem-today";
} else {
$class = $classes->[$day] || "rem-cell rem-cell-$number_of_rows-rows";
}
@@ -637,6 +641,11 @@
$in =~ s/\>/\>/g;
return $in;
}
+ at today = (localtime())[3..5];
+$today[1] = qw(January February March April May June
+ July August September October November December)[$today[1]];
+$today[2] += 1900;
parse_options();
if ($Options{help}) {
More information about the Remind-fans
mailing list