emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-test: Fix zone-dependent miscalculation of days of week


From: Ihor Radchenko
Subject: Re: [PATCH] org-test: Fix zone-dependent miscalculation of days of week
Date: Mon, 03 Jun 2024 15:00:24 +0000

Kyle Meyer <kyle@kyleam.com> writes:

> Three clock tests are failing on my end:
>
>    FAILED  test-org-clock/clock-drawer-dwim
>    FAILED  test-org-clock/org-clock-timestamps-change
>    FAILED  test-org-clok/org-clock-update-time-maybe
>
> Those stem from org-test-day-of-weeks-{abbrev,full} not having the
> expected value.  Those variables are supposed to list Sunday through
> Saturday in the machine's locale.  Here's what I see on my end:
>
>   org-test-day-of-weeks-full’s value is
>   ["Saturday" "Monday" "Monday" "Tuesday" "Wednesday" "Thursday"
>    "Friday"]
>
> The patch below fixes the issue on my end.  In addition to my usual
> locale, I tested it with another one (de_BE.utf8), and all the tests
> passed.
> ...
>  (defconst org-test-day-of-weeks-seconds
> -  [121223891                            ; Sun
> -   30000000                             ; Mon
> -   2222222                              ; Tue
> -   500000                               ; Wed
> -   1000                                 ; Thu
> -   89173                                ; Fri
> -   666666666]                           ; Sat
> +  [302400                               ; Sun
> +   388800                               ; Mon
> +   475200                               ; Tue
> +   561600                               ; Wed
> +   648000                               ; Thu
> +   734400                               ; Fri
> +   820800]                              ; Sat

I suspect that the failures are because of your timezone.
If my guess is right, there will always be some timezone where a given
number seconds from epoch is a different day...
I am not sure how to address this problem.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]