Re: [weewx-user] leap year and span

2024-03-01 Thread 'michael.k...@gmx.at' via weewx-user
To show the adding one month also, and to show, it's not only three, but sometime four day in a row, plus/minus one month, lead to the very same date, I've added a few lines to the java example: import java.time.*; public class Leaps { public static void main(String[] args) {

Re: [weewx-user] leap year and span

2024-03-01 Thread Tom Keffer
That's interesting! However, Python treats it differently. The equivalent would be something like import datetime march29_23 = datetime.date.fromisoformat("2023-03-29") print(march29_23 - datetime.timedelta(month=1)) Unfortunately, datetime.timedelta does not offer an argument "month", perhaps

Re: [weewx-user] leap year and span

2024-03-01 Thread Graham Eddy
“month” is a fuzzy measure, not precise. it is not surprising that arithmetic with fuzzy numbers produces fuzzy numbers. what *is* surprising is that people find the above surprising same as network distributed time - given the variable time it takes to transfer a “time” to another place, we

Re: [weewx-user] leap year and span

2024-03-01 Thread 'michael.k...@gmx.at' via weewx-user
Citing issue #436 "What is 30 March minus one month? By this solution, it should be 28 Feb. So then what is 29 March minus one month? Also 28 Feb? And so would 28 March minus a month. So, "one month earlier" for three days in a row leads to the same

Re: [weewx-user] leap year and span

2024-02-29 Thread Tom Keffer
I am not surprised that $year_delta=1 does not work on leap day. There is no 29 February 2023. This is issue #436 . On Thu, Feb 29, 2024 at 9:45 AM František Slimařík wrote: > Hi Tom, > > actually I found another for cycle which caused the issue.

Re: [weewx-user] leap year and span

2024-02-29 Thread František Slimařík
Hi Tom, actually I found another for cycle which caused the issue. When I changed delta from "$year_delta=1" into "$day_delta=365" it works again. Interesting it worked without any issue till yesterday :) ##for $A in $span($year_delta=1).months $A.dateTime.format("%OB

Re: [weewx-user] leap year and span

2024-02-29 Thread Tom Keffer
I just tried this and it worked fine: 28. February 2023;33.4 1. March 2023;36.1 2. March 2023;38.0 3. March 2023;37.1 ... 26. February 2024;37.3 27. February 2024;38.5 28. February 2024;41.3 On Wed, Feb 28, 2024 at 8:57 PM František Slimařík wrote: > Yes, right > > #for $i in

Re: [weewx-user] leap year and span

2024-02-28 Thread František Slimařík
Yes, right #for $i in $span($day_delta=365).days #set fDate = $i.dateTime.format("%-d. %B %Y") $fDate;$i.outTemp.avg.format(add_label=False) #end for čt 29. 2. 2024 v 1:49 odesílatel Tom Keffer napsal: > I don't know. How are you using the $span() tags? In a loop, I assume? > > On Wed, Feb 28,

Re: [weewx-user] leap year and span

2024-02-28 Thread Tom Keffer
I don't know. How are you using the $span() tags? In a loop, I assume? On Wed, Feb 28, 2024 at 3:25 PM František Slimařík wrote: > Hello, > > is it possible that leap year causes issue in span tag? I am using these: > > $span($day_delta=365).days > $span($year_delta=1).months > > Feb 29

[weewx-user] leap year and span

2024-02-28 Thread František Slimařík
Hello, is it possible that leap year causes issue in span tag? I am using these: $span($day_delta=365).days $span($year_delta=1).months Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/neowx/year.html.tmpl failed with