fix bugs, change day_of_week formated

This commit is contained in:
Marko Oldenburg
2019-01-14 18:16:39 +01:00
parent 8e90cdb3c4
commit 6499d7f858
3 changed files with 26 additions and 74 deletions

View File

@@ -262,7 +262,7 @@ sub _ProcessingRetrieveData($$) {
###### Ab hier wird die ResponseHash Referenze für die Rückgabe zusammen gestellt
$self->{cached}->{current_date_time} =
strftime( "%a, %e %b %Y %H:%M %p",
strftime( "%a, %e %b %Y %H:%M",
localtime( $self->{fetchTime} ) );
if ( $self->{endpoint} eq 'weather' ) {
@@ -310,15 +310,15 @@ sub _ProcessingRetrieveData($$) {
'code' => $codes{ $data->{weather}->[0]->{id} },
'iconAPI' => $data->{weather}->[0]->{icon},
'sunsetTime' => strftime(
"%a, %e %b %Y %H:%M %p",
"%a, %e %b %Y %H:%M",
localtime( $data->{sys}->{sunset} )
),
'sunriseTime' => strftime(
"%a, %e %b %Y %H:%M %p",
"%a, %e %b %Y %H:%M",
localtime( $data->{sys}->{sunrise} )
),
'pubDate' => strftime(
"%a, %e %b %Y %H:%M %p",
"%a, %e %b %Y %H:%M",
localtime( $data->{dt} )
),
};
@@ -337,13 +337,13 @@ sub _ProcessingRetrieveData($$) {
@{ $self->{cached}->{forecast}->{hourly} },
{
'pubDate' => strftime(
"%a, %e %b %Y %H:%M %p",
"%a, %e %b %Y %H:%M",
localtime(
( $data->{list}->[$i]->{dt} ) - 3600
)
),
'day_of_week' => strftime(
"%a",
"%a, %H:%M",
localtime(
( $data->{list}->[$i]->{dt} ) - 3600
)
@@ -462,7 +462,7 @@ sub _ErrorHandling($$) {
my ( $self, $err ) = @_;
$self->{cached}->{current_date_time} =
strftime( "%a, %e %b %Y %H:%M %p", localtime( $self->{fetchTime} ) ),
strftime( "%a, %e %b %Y %H:%M", localtime( $self->{fetchTime} ) ),
$self->{cached}->{status} = $err;
$self->{cached}->{validity} = 'stale';
}