[Remind-Fans] tkremind doesn't start week from monday even with -m flag
Dianne Skoll
dianne at skoll.ca
Fri Apr 1 12:10:16 EDT 2022
Hi,
> I use 3.4.0 version from official Arch Repository. Older
> versions showed weeks started from monday when i started tkremind with
> `-m` flag. But now "Monday" as first day appears for a second and
> after that Sunday becomes first day of the week. Is it a bug? And how
> to fix it?
Unfortunately, it is a bug. Fixed in this patch:
https://git.skoll.ca/Skollsoft-Public/Remind/commit/99af1f964c5c77a93d2dcb85a7fd34c7d9807c70
You can try applying the patch below to your version of tkremind.
Regards,
Dianne.
commit 99af1f964c5c77a93d2dcb85a7fd34c7d9807c70
Author: Dianne Skoll <dianne at skoll.ca>
Date: Fri Apr 1 12:08:25 2022 -0400
Fix bug that broke "-m" option to tkreminder.
diff --git a/scripts/tkremind b/scripts/tkremind
index 57e9856..bd0075d 100755
--- a/scripts/tkremind
+++ b/scripts/tkremind
@@ -457,6 +457,7 @@ proc CreateCalFrame { w dayNames } {
# Figure out reasonable height for text frames
global SetFontsWorked
global Option
+ global MondayFirst
set h [winfo screenheight .]
if {$h <= 480} {
if {$SetFontsWorked} {
@@ -470,7 +471,6 @@ proc CreateCalFrame { w dayNames } {
set h 5
}
- global MondayFirst
frame $w -background $Option(LineColor)
for {set i 0} {$i < 7} {incr i} {
if {$MondayFirst} {
@@ -1010,7 +1010,7 @@ proc ConfigureCalWindow { month year firstDay numDays } {
proc FillCalWindow {} {
set FileName ""
set LineNo 0
- global DayNames CurYear CurMonth MonthNames CommandLine Option TagToObj RemindErrors
+ global DayNames CurYear CurMonth MonthNames CommandLine Option TagToObj RemindErrors MondayFirst
array unset TagToObj
@@ -1049,7 +1049,12 @@ proc FillCalWindow {} {
# Update the day names in the calendar window
for {set i 0} {$i < 7} {incr i} {
- .cal.day$i configure -text [lindex $DayNames $i]
+ if {$MondayFirst} {
+ set index [expr ($i+1)%7]
+ } else {
+ set index $i
+ }
+ .cal.day$i configure -text [lindex $DayNames $index]
}
set offset [CalEntryOffset $firstWkday]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://dianne.skoll.ca/pipermail/remind-fans/attachments/20220401/8953a2fc/attachment.sig>
More information about the Remind-fans
mailing list