diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_0.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_0.png
new file mode 100644
index 0000000..c21e1ea
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_0.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_1.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_1.png
new file mode 100644
index 0000000..df86970
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_1.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_10.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_10.png
new file mode 100644
index 0000000..43a9d6d
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_10.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_11.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_11.png
new file mode 100644
index 0000000..f464284
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_11.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_12.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_12.png
new file mode 100644
index 0000000..663d64f
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_12.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_13.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_13.png
new file mode 100644
index 0000000..d5b6329
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_13.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_14.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_14.png
new file mode 100644
index 0000000..be417f3
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_14.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_15.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_15.png
new file mode 100644
index 0000000..be417f3
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_15.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_16.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_16.png
new file mode 100644
index 0000000..4291900
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_16.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_17.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_17.png
new file mode 100644
index 0000000..2a13a58
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_17.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_18.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_18.png
new file mode 100644
index 0000000..7192125
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_18.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_19.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_19.png
new file mode 100644
index 0000000..961ce2f
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_19.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_2.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_2.png
new file mode 100644
index 0000000..d0ea669
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_2.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_20.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_20.png
new file mode 100644
index 0000000..dff5ce3
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_20.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_21.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_21.png
new file mode 100644
index 0000000..a978722
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_21.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_22.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_22.png
new file mode 100644
index 0000000..a895d22
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_22.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_23.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_23.png
new file mode 100644
index 0000000..6332b82
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_23.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_24.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_24.png
new file mode 100644
index 0000000..2c92d66
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_24.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_25.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_25.png
new file mode 100644
index 0000000..8af889c
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_25.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_26.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_26.png
new file mode 100644
index 0000000..e091a4e
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_26.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_27.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_27.png
new file mode 100644
index 0000000..647141d
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_27.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_28.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_28.png
new file mode 100644
index 0000000..dc426c5
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_28.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_29.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_29.png
new file mode 100644
index 0000000..d1fcaee
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_29.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_3.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_3.png
new file mode 100644
index 0000000..8fca327
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_3.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_30.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_30.png
new file mode 100644
index 0000000..0e26faa
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_30.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_4.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_4.png
new file mode 100644
index 0000000..494189e
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_4.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_5.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_5.png
new file mode 100644
index 0000000..a34d24d
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_5.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_6.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_6.png
new file mode 100644
index 0000000..c345779
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_6.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_7.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_7.png
new file mode 100644
index 0000000..345baa4
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_7.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_8.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_8.png
new file mode 100644
index 0000000..f8779e6
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_8.png differ
diff --git a/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_9.png b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_9.png
new file mode 100644
index 0000000..d218e0e
Binary files /dev/null and b/SuperDateTime/HTML/EN/plugins/SuperDateTime/html/images/moon_9.png differ
diff --git a/SuperDateTime/install.xml b/SuperDateTime/install.xml
index ca9c8e6..a1c8664 100644
--- a/SuperDateTime/install.xml
+++ b/SuperDateTime/install.xml
@@ -3,11 +3,11 @@
8F9E67E0-A278-11DB-8AB9-0800200C9A67
PLUGIN_SCREENSAVER_SUPERDATETIME
Plugins::SuperDateTime::Plugin
- 5.9.50
+ 5.9.51
SETUP_GROUP_SUPERDATETIME_DESC
G. Brown, D. Grossman
enabled
- https://sourceforge.net/projects/sdt-weather-com/
+ https://github.com/paul-1/SuperDateTime
plugins/SuperDateTime/settings/basic.html
2
diff --git a/SuperDateTime/lib/Plugins/SuperDateTime/Plugin.pm b/SuperDateTime/lib/Plugins/SuperDateTime/Plugin.pm
index 4ee8413..d41647e 100644
--- a/SuperDateTime/lib/Plugins/SuperDateTime/Plugin.pm
+++ b/SuperDateTime/lib/Plugins/SuperDateTime/Plugin.pm
@@ -18,10 +18,12 @@
# The graphical weather icons and the code to support them are based on the WeatherTime screensaver written by Martin Rehfeld.
#
# VERSION HISTORY
+# 5.9.51 03/17/19 Added moonphase infromation. Taken from old WU version. Thanks tcutting.
+#
# 5.9.50 03/16/19 Adjusted 15 day forecast to start with the current day.
#
# 5.9.49 02/18/19 Fixed certain NCAA team ICONs that were not displaying correctly.
-# Added handling for Postponed College Basketball games.
+# Added handling for Postponed College Basketball games.
# Cleaned up "Extras" display on Touch/Radio/Controller.
#
# 5.9.48 11/27/18 NCAA updated url for college football.
@@ -203,6 +205,7 @@ use HTML::TreeBuilder;
use Time::Local;
use HTML::Entities qw(decode_entities);
use JSON::XS::VersionOneAndTwo;
+use Time::localtime;
my $prefs = preferences('plugin.superdatetime');
@@ -213,7 +216,7 @@ my $log = Slim::Utils::Log->addLogCategory({
});
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 5.9.50 $,10);
+$VERSION = substr(q$Revision: 5.9.51 $,10);
$Plugins::SuperDateTime::Plugin::apiVersion = 2.0;
@@ -391,7 +394,7 @@ my $Gclient;
#
my %Codepage = ( ' ' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4,
'5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9,
- '0' => 10, '-' => 11, '°' => 12, '.' => 13, '%' => 14,
+ '0' => 10, '-' => 11, '�' => 12, '.' => 13, '%' => 14,
'A' => 15, 'B' => 16, 'C' => 17, 'D' => 18, 'E' => 19,
'F' => 20, 'G' => 21, 'H' => 22, 'I' => 23, 'J' => 24,
'K' => 25, 'L' => 26, 'M' => 27, 'N' => 28, 'O' => 29,
@@ -2238,7 +2241,7 @@ sub sdt10day {
push @menu, {
'icon-id' => 'plugins/SuperDateTime/html/images/'.$wetData{'d'.$i}{'forecastIcon'}.'.png',
text => $wetData{'d'.$i}{'day'}.' '.$wetData{'d'.$i}{'date'}.
- $wetData{'d'.$i}{'condition'}.' '.$wetData{'d'.$i}{'high'.$ForC} . '°/' .$wetData{'d'.$i}{'low'.$ForC} . '° Precip. ' . $wetData{'d'.$i}{'precip'}.'%',
+ $wetData{'d'.$i}{'condition'}.' '.$wetData{'d'.$i}{'high'.$ForC} . '�/' .$wetData{'d'.$i}{'low'.$ForC} . '� Precip. ' . $wetData{'d'.$i}{'precip'}.'%',
};
$i++;
@@ -2377,7 +2380,7 @@ sub sdtForecast {
push @menu, {
'icon-id' => 'plugins/SuperDateTime/html/images/'.$wetData{$i}{'forecastIcon'}.'.png',
text => $wetData{$i}{'forecastTOD'}.": ".$wetData{$i}{'skyCondition'}."\n".
- $wetData{$i}{'forecastType'} .' '. $wetData{$i}{'forecastTemp'.$ForC} . '° Precip. '. $wetData{$i}{'forecastPrec'}.'%',
+ $wetData{$i}{'forecastType'} .' '. $wetData{$i}{'forecastTemp'.$ForC} . '� Precip. '. $wetData{$i}{'forecastPrec'}.'%',
actions => {
go => {
player => 0,
@@ -2458,8 +2461,8 @@ sub sdtCurrent {
push @menu, {
'icon-id' => 'plugins/SuperDateTime/html/images/'.$wetData{-1}{'forecastIcon'}.'.png',
- text => $wetData{-1}{'skyCondition'}.' '.$wetData{'temperature'.$ForC}.'° ('.$wetData{'feelslike'.$ForC}.'°) '. $wetData{'windspeed_'.$WindUnit}."\n".
- $wetData{-1}{'forecastType'}.' '. $wetData{-1}{'forecastTemp'.$ForC}.'° Precip. '.$wetData{-1}{'forecastPrec'}.'%',
+ text => $wetData{-1}{'skyCondition'}.' '.$wetData{'temperature'.$ForC}.'� ('.$wetData{'feelslike'.$ForC}.'�) '. $wetData{'windspeed_'.$WindUnit}."\n".
+ $wetData{-1}{'forecastType'}.' '. $wetData{-1}{'forecastTemp'.$ForC}.'� Precip. '.$wetData{-1}{'forecastPrec'}.'%',
actions => {
go => {
player => 0,
@@ -2473,7 +2476,7 @@ sub sdtCurrent {
push @menu, {
'icon-id' => 'plugins/SuperDateTime/html/images/blank.png',
text => 'Pressure: '.$wetData{'pressureIN'}.' '.$wetData{'pressureT'}."\n".
- 'Humidity: '.$wetData{'humidity'}.'° Dewpoint: '.$wetData{'dewpointF'}.'°',
+ 'Humidity: '.$wetData{'humidity'}.'� Dewpoint: '.$wetData{'dewpointF'}.'�',
};
push @menu, {
'icon-id' => 'plugins/SuperDateTime/html/images/blank.png',
@@ -2796,15 +2799,15 @@ sub replaceMacros {
s/%2/$date/;
s/%!2/$sdate/;
- s/%t/$wetData{'temperatureF'}°/;
- s/%T/$wetData{'temperatureC'}°/;
+ s/%t/$wetData{'temperatureF'}�/;
+ s/%T/$wetData{'temperatureC'}�/;
s/%h/$wetData{'humidity'}/;
s/%p/$wetData{'pressureIN'}$wetData{'pressureT'}/;
s/%P/$wetData{'pressureMB'}$wetData{'pressureT'}/;
- s/%d/$wetData{'dewpointF'}°/;
- s/%D/$wetData{'dewpointC'}°/;
- s/%f/$wetData{'feelslikeF'}°/;
- s/%F/$wetData{'feelslikeC'}°/;
+ s/%d/$wetData{'dewpointF'}�/;
+ s/%D/$wetData{'dewpointC'}�/;
+ s/%f/$wetData{'feelslikeF'}�/;
+ s/%F/$wetData{'feelslikeC'}�/;
s/%w/$wetData{'windspeed_mh'}/;
s/%W/$wetData{'windspeed_kh'}/;
s/%q/$wetData{'windspeed_kth'}/;
@@ -2815,19 +2818,20 @@ sub replaceMacros {
s/%B/$wetData{'snow'}/;
#Wunderground
- s/%e/$wetData{'wu_temperatureF'}°/;
- s/%r/$wetData{'wu_temperatureFr'}°/;
- s/%E/$wetData{'wu_temperatureC'}°/;
- s/%R/$wetData{'wu_temperatureCr'}°/;
+ s/%e/$wetData{'wu_temperatureF'}�/;
+ s/%r/$wetData{'wu_temperatureFr'}�/;
+ s/%E/$wetData{'wu_temperatureC'}�/;
+ s/%R/$wetData{'wu_temperatureCr'}�/;
s/%H/$wetData{'wu_humidity'}/;
s/%l/$wetData{'wu_pressureIN'}/;
s/%L/$wetData{'wu_pressureMB'}/;
- s/%m/$wetData{'wu_dewpointF'}°/;
- s/%M/$wetData{'wu_dewpointC'}°/;
+ s/%m/$wetData{'wu_dewpointF'}�/;
+ s/%M/$wetData{'wu_dewpointC'}�/;
s/%j/$wetData{'wu_windspeed_mh'}/;
s/%J/$wetData{'wu_windspeed_kh'}/;
s/%k/$wetData{'wu_windspeed_kth'}/;
- s/%K/$wetData{'wu_windspeed_ms'}/;
+ s/%K/$wetData{'wu_windspeed_ms'}/;
+
}
return $string;
@@ -2841,16 +2845,19 @@ sub replaceMacrosPer {
$string = replaceMacros($string, $client);
for ($string) {
- s/%a/$wetData{$location}{'average_F'}°/;
- s/%A/$wetData{$location}{'average_C'}°/;
- s/%c/$wetData{$location}{'record_F'}°/;
- s/%C/$wetData{$location}{'record_C'}°/;
+ s/%a/$wetData{$location}{'average_F'}�/;
+ s/%A/$wetData{$location}{'average_C'}�/;
+ s/%c/$wetData{$location}{'record_F'}�/;
+ s/%C/$wetData{$location}{'record_C'}�/;
s/%g/$wetData{$location}{'record_year'}/;
s/%s/$wetData{$location}{'sunrise'}/;
s/%S/$wetData{$location}{'sunset'}/;
+ s/%G/$wetData{$location}{'moonPhrase'}/;
+ s/%n/$wetData{$location}{'moonrise'}/;
+ s/%N/$wetData{$location}{'moonset'}/;
- s/%z/$wetData{$location}{'forecastType'} $wetData{$location}{'forecastTempF'}°/;
- s/%Z/$wetData{$location}{'forecastType'} $wetData{$location}{'forecastTempC'}°/;
+ s/%z/$wetData{$location}{'forecastType'} $wetData{$location}{'forecastTempF'}�/;
+ s/%Z/$wetData{$location}{'forecastType'} $wetData{$location}{'forecastTempC'}�/;
s/%!z/$wetData{$location}{'forecastTempF'}/;
s/%!Z/$wetData{$location}{'forecastTempC'}/;
s/Low/ Low/;
@@ -2864,10 +2871,10 @@ sub replaceMacrosPer {
s/%_3/$wetData{$location}{'day'}/;
s/%!_3/$wetData{$location}{'shortday'}/;
s/%_4/$wetData{$location}{'date'}/;
- s/%_5/$wetData{$location}{'highF'}°/;
- s/%_6/$wetData{$location}{'highC'}°/;
- s/%_7/$wetData{$location}{'lowF'}°/;
- s/%_8/$wetData{$location}{'lowC'}°/;
+ s/%_5/$wetData{$location}{'highF'}�/;
+ s/%_6/$wetData{$location}{'highC'}�/;
+ s/%_7/$wetData{$location}{'lowF'}�/;
+ s/%_8/$wetData{$location}{'lowC'}�/;
s/%_9/$wetData{$location}{'precip'}/;
s/%_0/$wetData{$location}{'condition'}/;
}
@@ -3188,6 +3195,58 @@ sub gotWeatherToday { #Weather data for today was received
$wetData{2}{'sunset'} = $ss;
}
+ # Moonrise moonset for Today. Store in both current[-1] and today/tonight[0] periods.
+ my $moonrise = @$moonrises[0];
+ my $timepos5 = index($moonrise, ":");
+ $timepos5 = $timepos5-2;
+ my $mr = substr($moonrise, $timepos5, 5);
+ $wetData{-1}{'moonrise'} = $mr;
+ $wetData{0}{'moonrise'} = $mr;
+
+ my $moonset = @$moonsets[0];
+ my $timepos6 = index($moonset, ":");
+ $timepos6 = $timepos6-2;
+ my $ms = substr($moonset, $timepos6, 5);
+ $wetData{-1}{'moonset'} = $ms;
+ $wetData{0}{'moonset'} = $ms;
+
+ my $moonphrase = @$moonPhrases[0];
+ $wetData{-1}{'moonPhrase'} = $moonphrase;
+ $wetData{0}{'moonPhrase'} = $moonphrase;
+
+ # Calculate Moon Age https://www.subsystems.us/uploads/9/8/9/4/98948044/moonphase.pdf
+ # First calulate julian date
+ my $Y = localtime->year() + 1900;
+ my $M = localtime->mon() + 1;
+ my $D = localtime->mday();
+
+ if ( ($M == 1) | ($M == 2)){
+ $Y = $Y - 1;
+ $M = $M + 12;
+ }
+
+ my $A = int($Y/100);
+ my $B = int($A/4);
+ my $C = 2-$A+$B;
+ my $E = int(365.25 * ($Y+4716));
+ my $F = int(30.6001 * ($M+1));
+ my $JulianDate = $C+$D+$E+$F-1524.5;
+
+ # Now Calulate number of days/new moons since a known New Moon Jan 06,2000
+ my $DaysSinceNewMoon = $JulianDate - 2451549.5;
+ my $New_Moons = $DaysSinceNewMoon / 29.53;
+
+ #Calculate the number of days since last new moon.
+ my $frac = ($New_Moons - int($New_Moons));
+ my $MoonAge = sprintf "%d", int($frac * 29.53);
+
+ #Images are for northern hemisphere, map images for southern hemisphere.
+ if ($lat < 0 ){
+ $MoonAge = 30 - $MoonAge
+ }
+ $log->debug('Moon age: ' . $MoonAge);
+ $wetData{'moonphaseURL'} ='/plugins/SuperDateTime/html/images/moon_'. $MoonAge . '.png';
+
# 10 day stuff moved from got10day
my %mons=("01"=>"Jan","02"=>"Feb","03"=>"Mar","04"=>"Apr","05"=>"May","06"=>"Jun","07"=>"Jul","08"=>"Aug","09"=>"Sep","10"=>"Oct","11"=>"Nov","12"=>"Dec");
my $dayval = "" ;