mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
Fixed weather date
This commit is contained in:
@ -62,7 +62,7 @@ angular.module('ionic.weather', ['ionic.weather.services', 'ionic.weather.direct
|
|||||||
if($scope.bgImages) {
|
if($scope.bgImages) {
|
||||||
$scope.activeBgImage = $scope.bgImages[$scope.activeBgImageIndex++ % $scope.bgImages.length];
|
$scope.activeBgImage = $scope.bgImages[$scope.activeBgImageIndex++ % $scope.bgImages.length];
|
||||||
}
|
}
|
||||||
$timeout(cycle, 5000);
|
$timeout(cycle, 10000);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -7,12 +7,11 @@ angular.module('ionic.weather.directives', [])
|
|||||||
template: '<span class="current-time">{{currentTime}}</span>',
|
template: '<span class="current-time">{{currentTime}}</span>',
|
||||||
scope: {
|
scope: {
|
||||||
localtz: '=',
|
localtz: '=',
|
||||||
localTime: '='
|
|
||||||
},
|
},
|
||||||
link: function($scope, $element, $attr) {
|
link: function($scope, $element, $attr) {
|
||||||
$timeout(function checkTime() {
|
$timeout(function checkTime() {
|
||||||
if($scope.localTime && $scope.localtz) {
|
if($scope.localtz) {
|
||||||
$scope.currentTime = $filter('date')(parseInt($scope.localTime), 'h:mm') + $scope.localtz;
|
$scope.currentTime = $filter('date')(+(new Date), 'h:mm') + $scope.localtz;
|
||||||
}
|
}
|
||||||
$timeout(checkTime, 500);
|
$timeout(checkTime, 500);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
<header id="header" class="bar bar-header bar-clear">
|
<header id="header" class="bar bar-header bar-clear">
|
||||||
<h1 class="title">
|
<h1 class="title">
|
||||||
<span class="city">{{current.display_location.city}}</span><br>
|
<span class="city">{{current.display_location.city}}</span><br>
|
||||||
<current-time local-time="current.local_epoch" localtz="current.local_tz_short"></current-time>
|
<current-time localtz="current.local_tz_short"></current-time>
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div id="scroller" class="scroll padding" style="margin-top:44px">
|
<div id="scroller" class="scroll padding" style="margin-top:44px">
|
||||||
|
|||||||
Reference in New Issue
Block a user