forked from mirrors/Scribe.js
Update dates for timezone
This commit is contained in:
parent
b08420a590
commit
b40c1fddf5
6 changed files with 22 additions and 16 deletions
|
@ -24,7 +24,7 @@
|
|||
* Go to to a next page
|
||||
*
|
||||
* @param {int} next if < 0, goes to older dates, if > 0 goes to newer dates
|
||||
*/
|
||||
*/
|
||||
$scope.nextPage = function (next) {
|
||||
|
||||
var currentDate = $location.search().from || Date.now(),
|
||||
|
@ -42,17 +42,21 @@
|
|||
|
||||
//build blocks
|
||||
$scope.blocks = dates.map(function (item) {
|
||||
|
||||
|
||||
var itemDate = $rootScope.timezoneDate(item.date);
|
||||
console.log(item.date);
|
||||
console.log(itemDate);
|
||||
|
||||
return {
|
||||
type : 'date',
|
||||
messageTop : $filter('date')(item.date, 'MMM'),
|
||||
message : $filter('date')(item.date, 'd'),
|
||||
messageBottom : $filter('date')(item.date, 'yyyy'),
|
||||
messageTop : $filter('date')(itemDate, 'MMM'),
|
||||
message : $filter('date')(itemDate, 'd'),
|
||||
messageBottom : $filter('date')(itemDate, 'yyyy'),
|
||||
click : function () {
|
||||
//save files
|
||||
logs.setLogs(item.files.map(function (el, index) {
|
||||
return {
|
||||
selected : index === 0, //select the first by default
|
||||
selected : index === 0, //select the first by default
|
||||
name : el.name,
|
||||
path : el.path
|
||||
};
|
||||
|
@ -62,7 +66,7 @@
|
|||
$rootScope.go('logs');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
'logs',
|
||||
'folder',
|
||||
function ($scope, $rootScope, logs, folder) {
|
||||
|
||||
|
||||
//reset
|
||||
$rootScope.sidebar = false;
|
||||
$scope.onlyFiles = true;
|
||||
|
||||
//build each block
|
||||
$scope.blocks = folder.map(function (item) {
|
||||
|
||||
|
||||
if (item.type !== 'file') {
|
||||
$scope.onlyFiles = false;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
|||
message : item.name,
|
||||
click : function () {
|
||||
if (item.type === 'file') {
|
||||
|
||||
|
||||
//Save all current files of the folder
|
||||
//But select only the clicked one
|
||||
var newFiles = folder.map(function (file) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
//build block for each logWriter
|
||||
$scope.blocks = $rootScope.logWriters.map(function (item) {
|
||||
|
||||
|
||||
return {
|
||||
message : item,
|
||||
click : function () {
|
||||
|
|
|
@ -69,7 +69,9 @@
|
|||
templateUrl : 'partials/elements/log.html',
|
||||
replace : true,
|
||||
|
||||
controller : ['$scope', function ($scope) {
|
||||
controller : ['$rootScope', '$scope', function ($rootScope, $scope) {
|
||||
|
||||
$scope.timezoneDate = $rootScope.timezoneDate;
|
||||
|
||||
/**
|
||||
* $scope.handleTags
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
|
||||
<span class="log__item log__time log__time_80" ng-if="showDate != 0 && (showDate == 1 || log.show.date)">
|
||||
<span class="log__time__higher">
|
||||
{{log.context.time | date: 'EEE MMM dd yyyy'}}
|
||||
{{timezoneDate(log.context.time) | date: 'EEE MMM dd yyyy'}}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span class="log__item log__time log__time_122" ng-if="showTime != 0 && (showTime == 1 || log.show.time)">
|
||||
<span class="log__time__lower">
|
||||
{{log.context.time | date: 'yyyy-MM-ddTHH:mm:ss:Z'}}
|
||||
{{timezoneDate(log.context.time) | date: 'yyyy-MM-ddTHH:mm:ss:Z'}}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
</h3>
|
||||
|
||||
<ul class="content">
|
||||
|
||||
|
||||
<li ng-repeat="logger in logWriters" class="sidebar__item">
|
||||
<a href="" ng-click="go(mode, {path : logger});">{{logger}}</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue