--- Plugin.pm 2007/05/24 03:15:19 1.3 +++ Plugin.pm 2007/05/24 03:44:08 @@ -2735,7 +2735,7 @@ $forecastG[0] = getFramebuf($client,$gxwidth); #Date $forecastG[1] = $forecastG[0]; #Current #push(@TOPdisplayItems, Slim::Utils::Misc::longDateF()); #Long date - push(@TOPdisplayItems, Slim::Utils::DateTime::longDateF(undef,Slim::Utils::Prefs::get('dateFormat'))); + push(@TOPdisplayItems, Slim::Utils::DateTime::longDateF(&getFuzzyTime($client),Slim::Utils::Prefs::get('dateFormat'))); push(@TOPdisplayItems, 'Currently: '.$skyCondition); #Current conditions $btmLinePreSpace[0] = $iconPreSpace; $btmLinePreSpace[1] = $iconPreSpace; @@ -2813,7 +2813,7 @@ $forecastG[6] = getFramebuf($client,$gxwidth); #Date $forecastG[7] = $forecastG[6]; #Current no 3line #push(@TOPdisplayItems, Slim::Utils::Misc::longDateF()); #Long date - push(@TOPdisplayItems, Slim::Utils::DateTime::longDateF(undef,Slim::Utils::Prefs::get('dateFormat'))); + push(@TOPdisplayItems, Slim::Utils::DateTime::longDateF(&getFuzzyTime($client),Slim::Utils::Prefs::get('dateFormat'))); push(@TOPdisplayItems, 'Currently: '.$skyCondition); #Current conditions $btmLinePreSpace[6] = $icon2PreSpace; $btmLinePreSpace[7] = $icon2PreSpace; @@ -5360,7 +5360,7 @@ } #Update alarm clock status indicator - my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(&getFuzzyTime($client)); my $alarmOn = Slim::Utils::Prefs::clientGet($client, "alarm", 0) || Slim::Utils::Prefs::clientGet($client, "alarm", $wday); if ($alarmOn) { @@ -5679,7 +5679,7 @@ my $hash; if ($nowshowing{$client} == 0) { #Show time and temperature - my $time = Slim::Utils::DateTime::timeF(undef,Slim::Utils::Prefs::get('timeFormat')); + my $time = &getFuzzyTimeF($client,undef,Slim::Utils::Prefs::get('timeFormat')); $displayLine2{$client} = $weatherString1b; $displayLine2{$client} =~ s/%1/$time/; @@ -5695,7 +5695,7 @@ } else { #Show the date #$displayLine1{$client} = Slim::Utils::Misc::longDateF(); - $displayLine1{$client} = Slim::Utils::DateTime::longDateF(undef,Slim::Utils::Prefs::get('dateFormat')) + $displayLine1{$client} = Slim::Utils::DateTime::longDateF(&getFuzzyTime($client),Slim::Utils::Prefs::get('dateFormat')) } } @@ -5861,7 +5861,7 @@ my $dispHash; if ($client->display->hasScreen2()) { #Dual screens - my $time = Slim::Utils::DateTime::timeF(undef,Slim::Utils::Prefs::get('timeFormat')); + my $time = &getFuzzyTimeF($client,undef,Slim::Utils::Prefs::get('timeFormat')); my $line1; my $line2 = $weatherString1b; $line2 =~ s/%1/$time/; #Add the time if its included @@ -5871,7 +5871,7 @@ } else { #Show the date #$line1 = Slim::Utils::Misc::longDateF(); - $line1 = Slim::Utils::DateTime::longDateF(undef,Slim::Utils::Prefs::get('dateFormat')) + $line1 = Slim::Utils::DateTime::longDateF(&getFuzzyTime($client),Slim::Utils::Prefs::get('dateFormat')) } my $timeHash; @@ -5926,6 +5926,22 @@ return $dispHash; } +sub getFuzzyTime { + my $client = shift; + if ( defined($Plugins::FuzzyTime::Plugin::apiVersion) ) { + return int(Plugins::FuzzyTime::Public::getClientTime($client)); + } + return time(); +} + +sub getFuzzyTimeF { + my ($client, $time, $format) = @_; + if ( defined($Plugins::FuzzyTime::Plugin::apiVersion) ) { + return Plugins::FuzzyTime::Public::timeF($client,$time,$format); + } + return Slim::Utils::DateTime::timeF($time,$format); +} + 1; __END__