Dates localization
This commit is contained in:
parent
b7ff480e17
commit
d0a46ee8ab
17 changed files with 35 additions and 106 deletions
|
|
@ -3,17 +3,7 @@ var PHPCensor = {
|
|||
intervals: {},
|
||||
|
||||
init: function () {
|
||||
// Setup the date locale
|
||||
moment.locale(LANGUAGE);
|
||||
|
||||
$(document).ready(function () {
|
||||
// Format datetimes
|
||||
$('time[datetime]').each(function() {
|
||||
var thisDate = $(this).attr('datetime');
|
||||
var formattedDate = moment(thisDate).format($(this).data('format') || 'lll');
|
||||
$(this).text(formattedDate);
|
||||
});
|
||||
|
||||
// Update latest builds every 5 seconds:
|
||||
PHPCensor.getBuilds();
|
||||
PHPCensor.intervals.getBuilds = setInterval(PHPCensor.getBuilds, 5000);
|
||||
|
|
@ -27,8 +17,6 @@ var PHPCensor = {
|
|||
PHPCensor.intervals.getDashboard = setInterval(PHPCensor.getDashboard, 10000);
|
||||
PHPCensor.intervals.getTimeline = setInterval(PHPCensor.getTimeline, 10000);
|
||||
}
|
||||
|
||||
PHPCensor.uiUpdated();
|
||||
});
|
||||
|
||||
$(window).on('builds-updated', function (e, data) {
|
||||
|
|
@ -123,7 +111,6 @@ var PHPCensor = {
|
|||
|
||||
success: function (data) {
|
||||
success();
|
||||
PHPCensor.uiUpdated();
|
||||
},
|
||||
|
||||
error: PHPCensor.handleFailedAjax
|
||||
|
|
@ -134,28 +121,6 @@ var PHPCensor = {
|
|||
if (xhr.status == 401) {
|
||||
window.location.href = window.APP_URL + 'session/login';
|
||||
}
|
||||
},
|
||||
|
||||
uiUpdated: function () {
|
||||
$('.duration').each(function () {
|
||||
var seconds = $(this).data('duration');
|
||||
|
||||
if (seconds == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(this).text(moment.duration(seconds, 'seconds').humanize());
|
||||
});
|
||||
|
||||
$('.datetime').each(function () {
|
||||
var dateString = $(this).data('date');
|
||||
|
||||
if (!dateString) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(this).text(moment(dateString).format('lll'));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -506,5 +471,3 @@ var Lang = {
|
|||
return string;
|
||||
}
|
||||
};
|
||||
|
||||
moment.locale(LANGUAGE);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
|
||||
id: 'build-codeception-errors',
|
||||
css: 'col-lg-12 col-md-12 col-sm-12 col-xs-12',
|
||||
css: 'col-xs-12',
|
||||
title: Lang.get('codeception'),
|
||||
lastData: null,
|
||||
lastMeta: null,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
var phpspecPlugin = ActiveBuild.UiPlugin.extend({
|
||||
id: 'build-phpspec-errors',
|
||||
css: 'col-lg-12 col-md-12 col-sm-12 col-xs-12',
|
||||
css: 'col-xs-12',
|
||||
title: Lang.get('phpspec'),
|
||||
lastData: null,
|
||||
displayOnUpdate: false,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
var phptalPlugin = ActiveBuild.UiPlugin.extend({
|
||||
id: 'build-phptal',
|
||||
css: 'col-lg-6 col-md-12 col-sm-12 col-xs-12',
|
||||
css: 'col-xs-12',
|
||||
title: 'PHPTAL Lint',
|
||||
lastData: null,
|
||||
box: true,
|
||||
|
|
@ -25,9 +25,9 @@ var phptalPlugin = ActiveBuild.UiPlugin.extend({
|
|||
return $('<div class="table-responsive"><table class="table" id="phptal-data">' +
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
' <th>File</th>' +
|
||||
' <th>Line</th>' +
|
||||
' <th>Message</th>' +
|
||||
' <th>' + Lang.get('file') + '</th>' +
|
||||
' <th>' + Lang.get('line') + '</th>' +
|
||||
' <th>' + Lang.get('message') + '</th>' +
|
||||
'</tr>' +
|
||||
'</thead><tbody></tbody></table></div>');
|
||||
},
|
||||
|
|
|
|||
|
|
@ -65,8 +65,6 @@ var Build = Class.extend({
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
PHPCensor.uiUpdated();
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -179,7 +177,7 @@ var Build = Class.extend({
|
|||
|
||||
UiPlugin: Class.extend({
|
||||
id: null,
|
||||
css: 'col-lg-4 col-md-6 col-sm-12 col-xs-12',
|
||||
css: 'col-xs-12',
|
||||
box: false,
|
||||
|
||||
init: function(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue