Affichage date dernier relevé K-Psul en heure locale

This commit is contained in:
Aurélien Delobelle 2016-08-23 03:39:33 +02:00
parent 093c7ffb0e
commit 8f76986f89

View file

@ -272,19 +272,29 @@ $(document).ready(function() {
'last_statement_by_last_name' : '' , 'last_statement_by_last_name' : '' ,
} }
var last_statement_container = $('#last_statement'); var last_statement_container = $('#last_statement');
var last_statement_html_default = '<b>Dernier relevé: </b><br><span id="checkout-last_statement_balance"></span>à <span id="checkout-last_statement_at"></span> par <span id="checkout-last_statement_by_trigramme"></span>'; var last_statement_html_default = '<b>Dernier relevé: </b><br><span id="checkout-last_statement_balance"></span>le <span id="checkout-last_statement_at"></span> par <span id="checkout-last_statement_by_trigramme"></span>';
// Display data // Display data
function displayCheckoutData() { function displayCheckoutData() {
var at_formated = '';
if (checkout_data['last_statement_at']) { if (checkout_data['last_statement_at']) {
last_statement_container.html(last_statement_html_default); last_statement_container.html(last_statement_html_default);
at = new Date(checkout_data['last_statement_at']);
var at_date = at.getDate();
var at_month = at.getMonth()+1;
var at_year = at.getFullYear();
var at_hours = at.getHours();
var at_minutes = (at.getMinutes() < 10 ? '0' : '') + at.getMinutes();
var at_seconds = (at.getSeconds() < 10 ? '0' : '') + at.getSeconds();
at_formated = at_date+'/'+at_month+'/'+at_year+' à '+at_hours+':'+at_minutes;
} else { } else {
last_statement_container.html(''); last_statement_container.html('');
} }
for (var elem in checkout_data) { for (var elem in checkout_data) {
$('#checkout-'+elem).text(checkout_data[elem]); $('#checkout-'+elem).text(checkout_data[elem]);
} }
$('#checkout-last_statement_at').text(at_formated);
var buttons = ''; var buttons = '';
if (checkout_data['id'] !== 0) { if (checkout_data['id'] !== 0) {
buttons += '<a class="btn btn-primary" href="/k-fet/checkouts/'+checkout_data['id']+'/statements/add" title="Effectuer un relevé" target="_blank"><span class="glyphicon glyphicon-euro"></span></a>'; buttons += '<a class="btn btn-primary" href="/k-fet/checkouts/'+checkout_data['id']+'/statements/add" title="Effectuer un relevé" target="_blank"><span class="glyphicon glyphicon-euro"></span></a>';