Example how to use genVisibleTimespans() to get a table of Moon risings and 
Moon settings:

#from weewx.units import ValueTuple, ValueHelper

<!DOCTYPE html>

<html lang="$lang">

  <head>

    <meta charset="UTF-8" />

    <title>genVisibleTimespans() example</title>

    <meta name="description" content="an example how to use this function" 
/>

    <style>

      td, th { padding-left:5px; padding-right:5px; }

    </style>

  </head>

  <body>

    <h1>$gettext("Moon rise and set of the current month")</h1>

    <table>

      <tr>

        <th>$gettext('Rise')</th>

        <th>$gettext('Set')</th>

      </tr>

      #for $timespan in $almanac.moon.genVisibleTimespans(context='month')

      #set $rise_vh = 
$ValueHelper(ValueTuple($timespan[0],'unix_epoch','group_time'),context='month',formatter=$station.formatter)

      #set $set_vh = 
$ValueHelper(ValueTuple($timespan[1],'unix_epoch','group_time'),context='month',formatter=$station.formatter)

      <tr>

        <td>$rise_vh</td>

        <td>$set_vh</td>

      </tr>

      #end for

    </table>

  </body>

</html>



-- 
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 visit 
https://groups.google.com/d/msgid/weewx-user/ef56247b-e9f4-4b95-8466-0b5c61bd6cd8n%40googlegroups.com.

Reply via email to