Bug #379 Loopback trata las horas en UTC y deberia tratarlas en CEST

This commit is contained in:
gerard 2018-07-10 14:55:13 +02:00
parent 841a72a269
commit 1df2daa569
3 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import ngModule from '../../module';
import {toJsonDate} from 'core/src/lib/date';
class Controller {
constructor($scope, $http, $translate, vnApp) {
@ -35,7 +36,7 @@ class Controller {
let query = `/ticket/api/sales/${this.ticket.id}/priceDifference`;
let data = {
landed: this.ticket.landed,
landed: toJsonDate(this.ticket.landed),
addressFk: this.ticket.addressFk,
agencyModeFk: this.ticket.agencyModeFk,
warehouseFk: this.ticket.warehouseFk

View File

@ -32,14 +32,21 @@ module.exports = Self => {
throw new Error(`The sales of this ticket can't be modified`);
let travelDates = await model.Agency.getFirstShipped(params.ticket);
let shipped = new Date(travelDates.vShipped);
shipped.setMinutes(shipped.getMinutes() + shipped.getTimezoneOffset());
console.log(shipped);
let landed = new Date(travelDates.vLanded);
landed.setMinutes(landed.getMinutes() + landed.getTimezoneOffset());
console.log(shipped);
let newTicketParams = {
clientFk: params.ticket.clientFk,
addressFk: params.ticket.addressFk,
agencyModeFk: params.ticket.agencyModeFk,
warehouseFk: params.ticket.warehouseFk,
shipped: travelDates.vShipped,
landed: travelDates.vLanded
shipped: shipped,
landed: landed
};
let newTicket = await model.Ticket.create(newTicketParams);

View File

@ -16,6 +16,7 @@
},
"salix": {
"connector": "vn-mysql",
"timezone": "CET",
"database": "salix",
"debug": false,
"host": "${salixHost}",
@ -27,6 +28,7 @@
},
"account": {
"connector": "vn-mysql",
"timezone": "CET",
"database": "account",
"debug": false,
"host": "${salixHost}",
@ -38,6 +40,7 @@
},
"edi": {
"connector": "vn-mysql",
"timezone": "CET",
"database": "edi",
"debug": false,
"host": "${salixHost}",
@ -49,6 +52,7 @@
},
"bs": {
"connector": "vn-mysql",
"timezone": "CET",
"database": "bs",
"debug": false,
"host": "${salixHost}",
@ -60,6 +64,7 @@
},
"hedera": {
"connector": "vn-mysql",
"timezone": "CET",
"database": "hedera",
"debug": false,
"host": "${salixHost}",