Pretty simple. I've been meaning to do that for myself by hadn't gotten
around to it yet.

You need a if statement just inside the loop like
#if $day.dateTime.format("%Y")<>$year.dateTime.format("%Y")

This compares the year returned by the loop to the current year, formatted
the same. If they are different output as normal.
You need to close the if with an #end if just before the #end for

Here's my code:
                #for $day in $this_span.periods
                   #if
$day.dateTime.format("%Y")<>$year.dateTime.format("%Y")
                      $day.dateTime.format("%Y")<br/>
                      &nbsp; H: $day.outTemp.max &nbsp;&nbspL:
$day.outTemp.min<br/>
                      #if $day.rain.sum.raw >0.0
                         &nbsp Rain: $day.rain.sum<br/>
                      #end if
                   #end if
                #end for

I have an extra #if to not print out rain if it's zero. If you get rain
throughout the year, you might want to remove the second #if line and first
#end if.

Good luck.

On Mon, May 27, 2019 at 3:33 AM Robin <[email protected]> wrote:

>
>>
> Gary,
>
> Thank you for the search list extension. It is very useful.
>
> I'm sorry to be a pest, I have one more question. I have been trying to
> see if I can exclude the current year so that I get only historic records.
> I have looked at the code to try and understand how it all works, but that
> simply reminds me that I don't understand code.
>
> Is there a way to exclude the current year?
>
> Thank you again.
>
> Robin
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/ae22c835-f43a-48d5-80c7-c8690f1eadd3%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/ae22c835-f43a-48d5-80c7-c8690f1eadd3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Peter Quinn
(415)794-2264

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAA1SM20pAGjZCYbhe4dhxQcu2eRQdUFC1VfrwjGwc-itEi4FFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to