Changed by:
diff --git a/front/core/filters/dateTime.js b/front/core/filters/dateTime.js
index 75e629e75..de1506ead 100644
--- a/front/core/filters/dateTime.js
+++ b/front/core/filters/dateTime.js
@@ -9,8 +9,9 @@ dateTime.$inject = ['$filter'];
export default function dateTime($filter) {
return function(input, format) {
- let value = typeof input === 'string' ? new Date(input) : input;
-
+ let value = new Date(input);
+ let offset = value.getTimezoneOffset() * 60000;
+ value.setTime(value.getTime() + offset);
return $filter('date')(value, format);
};
}
diff --git a/gulpfile.js b/gulpfile.js
index ff68efaa1..dfc91c050 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -424,8 +424,7 @@ function dockerWait() {
user: dbConf.username,
password: dbConf.password,
host: dbConf.host,
- port: dbConf.port,
- dateStrings: true
+ port: dbConf.port
};
log('Waiting for MySQL init process...');
diff --git a/loopback/server/connectors/vn-mysql.js b/loopback/server/connectors/vn-mysql.js
index 7ef2f920b..2ea30b598 100644
--- a/loopback/server/connectors/vn-mysql.js
+++ b/loopback/server/connectors/vn-mysql.js
@@ -22,7 +22,6 @@ class VnMySQL extends MySQL {
return v < 10 ? '0' + v : v;
}
}
-
fromColumnValue(prop, val) {
if (val == null || !prop || prop.type !== Date)
return MySQL.prototype.fromColumnValue.call(this, prop, val);
@@ -47,17 +46,6 @@ class VnMySQL extends MySQL {
* @return {Promise} The operation promise
*/
executeP(query, params, options = {}, cb) {
- if (params) {
- for (let param of params) {
- if (param && typeof param.getMonth === 'function' || this.isIsoDate(param)) {
- if (this.isIsoDate(param)) param = new Date(param);
- let locale = new Date(param);
- let offset = locale.getTimezoneOffset() * 60000;
- param.setTime(param.getTime() - offset);
- }
- }
- }
-
return new Promise((resolve, reject) => {
this.execute(query, params, options, (error, response) => {
if (cb)
diff --git a/loopback/server/datasources.json b/loopback/server/datasources.json
index 7fd1c48a7..3be007b90 100644
--- a/loopback/server/datasources.json
+++ b/loopback/server/datasources.json
@@ -1,6 +1,7 @@
{
"db": {
- "connector": "memory"
+ "connector": "memory",
+ "timezone": "local"
},
"vn": {
"connector": "vn-mysql",
diff --git a/modules/agency/front/descriptor/index.html b/modules/agency/front/descriptor/index.html
index 28d35efcd..772739843 100644
--- a/modules/agency/front/descriptor/index.html
+++ b/modules/agency/front/descriptor/index.html
@@ -31,7 +31,7 @@
value="{{$ctrl.zone.agencyMode.name}}">
+ value="{{$ctrl.zone.hour | dateTime: 'HH:mm'}}">
diff --git a/modules/agency/front/index/index.html b/modules/agency/front/index/index.html
index f1b866843..90ad97f56 100644
--- a/modules/agency/front/index/index.html
+++ b/modules/agency/front/index/index.html
@@ -36,7 +36,7 @@
{{::zone.name}}
{{::zone.agencyMode.name}}
{{::zone.warehouse.name}}
- {{::zone.hour | date: 'HH:mm'}}
+ {{::zone.hour | dateTime: 'HH:mm'}}
{{::zone.price | currency: 'EUR':2}}
+ value="{{::$ctrl.summary.hour | dateTime: 'HH:mm'}}">
diff --git a/modules/claim/front/action/index.html b/modules/claim/front/action/index.html
index 9f3a2e607..7bace5a0e 100644
--- a/modules/claim/front/action/index.html
+++ b/modules/claim/front/action/index.html
@@ -177,7 +177,7 @@
ng-repeat="ticket in lastTickets"
ng-click="$ctrl.importTicketLines(ticket.id)">
{{::ticket.id}}
- {{::ticket.shipped | date: 'dd/MM/yyyy'}}
+ {{::ticket.shipped | dateTime: 'dd/MM/yyyy'}}
{{::ticket.agencyMode.name}}
{{::ticket.warehouse.name}}
diff --git a/modules/claim/front/index/index.html b/modules/claim/front/index/index.html
index 67aedec4b..a486eac3b 100644
--- a/modules/claim/front/index/index.html
+++ b/modules/claim/front/index/index.html
@@ -41,7 +41,7 @@
{{::claim.client.name}}
- {{::claim.created | date:'dd/MM/yyyy'}}
+ {{::claim.created | dateTime:'dd/MM/yyyy'}}
- Since {{::classification.started | date:'dd/MM/yyyy'}}
- To {{classification.finished | date:'dd/MM/yyyy'}}
+ Since {{::classification.started | dateTime:'dd/MM/yyyy'}}
+ To {{classification.finished | dateTime:'dd/MM/yyyy'}}
@@ -35,7 +35,7 @@
+ value="{{::insurance.created | dateTime:'dd/MM/yyyy' }}">
diff --git a/modules/client/front/credit-insurance/insurance/index/index.html b/modules/client/front/credit-insurance/insurance/index/index.html
index b9a20bbb2..608f71e91 100644
--- a/modules/client/front/credit-insurance/insurance/index/index.html
+++ b/modules/client/front/credit-insurance/insurance/index/index.html
@@ -20,7 +20,7 @@
{{::insurance.credit | currency: 'EUR': 2}}
{{::insurance.grade}}
- {{::insurance.created | date: 'dd/MM/yyyy'}}
+ {{::insurance.created | dateTime: 'dd/MM/yyyy'}}
diff --git a/modules/client/front/credit/index/index.html b/modules/client/front/credit/index/index.html
index 3a9244f86..9757f8045 100644
--- a/modules/client/front/credit/index/index.html
+++ b/modules/client/front/credit/index/index.html
@@ -20,7 +20,7 @@
{{::credit.amount | number:2}} €
- {{::credit.created | date:'dd/MM/yyyy HH:mm'}}
+ {{::credit.created | dateTime:'dd/MM/yyyy HH:mm'}}
{{::credit.worker.user.nickname}}
diff --git a/modules/client/front/greuge/index/index.html b/modules/client/front/greuge/index/index.html
index 16b678d2d..a9d06cfa3 100644
--- a/modules/client/front/greuge/index/index.html
+++ b/modules/client/front/greuge/index/index.html
@@ -31,7 +31,7 @@
- {{::greuge.shipped | date:'dd/MM/yyyy HH:mm' }}
+ {{::greuge.shipped | dateTime:'dd/MM/yyyy HH:mm' }}
{{::greuge.description}}
{{::greuge.amount | currency: 'EUR': 2}}
{{::greuge.greugeType.name}}
diff --git a/modules/client/front/mandate/index.html b/modules/client/front/mandate/index.html
index 4b290d205..ad6345dd9 100644
--- a/modules/client/front/mandate/index.html
+++ b/modules/client/front/mandate/index.html
@@ -24,8 +24,8 @@
{{::mandate.id}}
{{::mandate.company.code}}
{{::mandate.mandateType.name}}
- {{::mandate.created | date:'dd/MM/yyyy HH:mm' }}
- {{::mandate.finished | date:'dd/MM/yyyy HH:mm' || '-'}}
+ {{::mandate.created | dateTime:'dd/MM/yyyy HH:mm' }}
+ {{::mandate.finished | dateTime:'dd/MM/yyyy HH:mm' || '-'}}
diff --git a/modules/client/front/note/index/index.html b/modules/client/front/note/index/index.html
index 59267b9c4..179a0d9a7 100644
--- a/modules/client/front/note/index/index.html
+++ b/modules/client/front/note/index/index.html
@@ -16,7 +16,7 @@
margin-small-bottom>
{{::note.worker.user.nickname}}
- {{::note.created | date:'dd/MM/yyyy HH:mm'}}
+ {{::note.created | dateTime:'dd/MM/yyyy HH:mm'}}
{{::note.text}}
diff --git a/modules/client/front/recovery/index/index.html b/modules/client/front/recovery/index/index.html
index 1e8009429..af996fc4f 100644
--- a/modules/client/front/recovery/index/index.html
+++ b/modules/client/front/recovery/index/index.html
@@ -30,8 +30,8 @@
ng-click="$ctrl.setFinished(recovery)">
- {{::recovery.started | date:'dd/MM/yyyy' }}
- {{recovery.finished | date:'dd/MM/yyyy' }}
+ {{::recovery.started | dateTime:'dd/MM/yyyy' }}
+ {{recovery.finished | dateTime:'dd/MM/yyyy' }}
{{::recovery.amount | currency: 'EUR': 0}}
{{::recovery.period}}
diff --git a/modules/client/front/sample/index/index.html b/modules/client/front/sample/index/index.html
index 50c25e3bb..7420cd14b 100644
--- a/modules/client/front/sample/index/index.html
+++ b/modules/client/front/sample/index/index.html
@@ -22,7 +22,7 @@
- {{::sample.created | date:'dd/MM/yyyy HH:mm' }}
+ {{::sample.created | dateTime:'dd/MM/yyyy HH:mm' }}
{{::sample.type.description}}
{{::sample.worker.user.nickname}}
{{::sample.company.code}}
diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html
index ad50b628b..f3fbc9753 100644
--- a/modules/client/front/summary/index.html
+++ b/modules/client/front/summary/index.html
@@ -192,7 +192,7 @@
+ value="{{$ctrl.summary.recovery.started | dateTime:'dd/MM/yyyy'}}">
diff --git a/modules/item/front/diary/index.html b/modules/item/front/diary/index.html
index 6a03d8505..db1581c4f 100644
--- a/modules/item/front/diary/index.html
+++ b/modules/item/front/diary/index.html
@@ -43,7 +43,7 @@
- {{::sale.date | date:'dd/MM/yyyy' }}
+ {{::sale.date | dateTime:'dd/MM/yyyy' }}
diff --git a/modules/item/front/history/index.html b/modules/item/front/history/index.html
index 4fbcb0cb7..83585f2b7 100644
--- a/modules/item/front/history/index.html
+++ b/modules/item/front/history/index.html
@@ -23,7 +23,7 @@
{{::itemLog.description}}
{{::itemLog.action}}
{{::itemLog.user.name}}
- {{::itemLog.creationDate | date:'dd/MM/yyyy HH:mm'}}
+ {{::itemLog.creationDate | dateTime:'dd/MM/yyyy HH:mm'}}
diff --git a/modules/item/front/last-entries/index.html b/modules/item/front/last-entries/index.html
index 8d921e118..f6548079b 100644
--- a/modules/item/front/last-entries/index.html
+++ b/modules/item/front/last-entries/index.html
@@ -45,7 +45,7 @@
{{entry.warehouse| dashIfEmpty}}
-
{{entry.landed | date:'dd/MM/yyyy HH:mm'}}
+
{{entry.landed | dateTime:'dd/MM/yyyy HH:mm'}}
{{entry.entryFk | dashIfEmpty}}
{{entry.price2 | dashIfEmpty}}
{{entry.price3 | dashIfEmpty}}
diff --git a/modules/order/back/models/order.json b/modules/order/back/models/order.json
index 0ae4dfd7b..ab10ad194 100644
--- a/modules/order/back/models/order.json
+++ b/modules/order/back/models/order.json
@@ -13,7 +13,7 @@
"description": "Identifier"
},
"landed": {
- "type": "date",
+ "type": "Date",
"required": true,
"mysql": {
"columnName": "date_send"
@@ -63,19 +63,19 @@
}
},
"created": {
- "type": "date",
+ "type": "Date",
"mysql": {
"columnName": "date_make"
}
},
"firstRowStamp": {
- "type": "date",
+ "type": "Date",
"mysql": {
"columnName": "first_row_stamp"
}
},
"confirmed": {
- "type": "date",
+ "type": "Date",
"mysql": {
"columnName": "confirm_date"
}
diff --git a/modules/order/front/descriptor/index.html b/modules/order/front/descriptor/index.html
index ffdbe2f25..9ea8d01fb 100644
--- a/modules/order/front/descriptor/index.html
+++ b/modules/order/front/descriptor/index.html
@@ -23,7 +23,7 @@
value="{{$ctrl.order.client.salesPerson.user.nickname}}">
+ value="{{$ctrl.order.landed | dateTime: 'dd/MM/yyyy' }}">
diff --git a/modules/order/front/line/index.html b/modules/order/front/line/index.html
index 54e743845..b95ef945c 100644
--- a/modules/order/front/line/index.html
+++ b/modules/order/front/line/index.html
@@ -47,7 +47,7 @@
{{::row.warehouse.name}}
- {{::row.shipped | date: 'dd/MM/yyyy'}}
+ {{::row.shipped | dateTime: 'dd/MM/yyyy'}}
{{::row.quantity}}
{{::row.price | currency: 'EUR':2}}
diff --git a/modules/order/front/summary/index.html b/modules/order/front/summary/index.html
index 738c34c46..eeed8f3e8 100644
--- a/modules/order/front/summary/index.html
+++ b/modules/order/front/summary/index.html
@@ -17,10 +17,10 @@
+ value="{{$ctrl.summary.created | dateTime: 'dd/MM/yyyy HH:mm'}}">
+ value="{{$ctrl.summary.confirmed | dateTime: 'dd/MM/yyyy'}}">
diff --git a/modules/ticket/front/descriptor/index.html b/modules/ticket/front/descriptor/index.html
index 956d15a91..948a5e63c 100644
--- a/modules/ticket/front/descriptor/index.html
+++ b/modules/ticket/front/descriptor/index.html
@@ -33,7 +33,7 @@
value="{{$ctrl.ticket.client.salesPerson.user.nickname}}">
+ value="{{$ctrl.ticket.shipped | dateTime: 'dd/MM/yyyy HH:mm' }}">
diff --git a/modules/ticket/front/expedition/index.html b/modules/ticket/front/expedition/index.html
index d10a4bdcb..118206c75 100644
--- a/modules/ticket/front/expedition/index.html
+++ b/modules/ticket/front/expedition/index.html
@@ -52,7 +52,7 @@
{{::expedition.userNickname | dashIfEmpty}}
- {{::expedition.created | date:'dd/MM/yyyy HH:mm'}}
+ {{::expedition.created | dateTime:'dd/MM/yyyy HH:mm'}}
diff --git a/modules/ticket/front/package/index.html b/modules/ticket/front/package/index.html
index a7a5fc923..d8a25c11a 100644
--- a/modules/ticket/front/package/index.html
+++ b/modules/ticket/front/package/index.html
@@ -34,7 +34,7 @@
diff --git a/modules/ticket/front/sale-tracking/index.html b/modules/ticket/front/sale-tracking/index.html
index f166b7882..a8284c571 100644
--- a/modules/ticket/front/sale-tracking/index.html
+++ b/modules/ticket/front/sale-tracking/index.html
@@ -54,7 +54,7 @@
{{::sale.state}}
- {{::sale.created | date: 'dd/MM/yyyy HH:mm'}}
+ {{::sale.created | dateTime: 'dd/MM/yyyy HH:mm'}}
diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html
index b962b6460..bfc98a9d9 100644
--- a/modules/ticket/front/sale/index.html
+++ b/modules/ticket/front/sale/index.html
@@ -254,7 +254,7 @@
ng-repeat="ticket in $ctrl.lastThreeTickets track by ticket.id"
ng-click="$ctrl.moveLines(ticket.id)">
{{::ticket.id}} |
- {{::ticket.shipped | date: 'dd/MM/yyyy HH:mm'}} |
+ {{::ticket.shipped | dateTime: 'dd/MM/yyyy HH:mm'}} |
{{::ticket.agencyName}} |
{{::ticket.warehouseName}} |
diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html
index 95711e3b3..6ce487f31 100644
--- a/modules/ticket/front/summary/index.html
+++ b/modules/ticket/front/summary/index.html
@@ -23,10 +23,10 @@
+ value="{{$ctrl.summary.shipped | dateTime: 'dd/MM/yyyy HH:mm'}}">
+ value="{{$ctrl.summary.landed | dateTime: 'dd/MM/yyyy'}}">
diff --git a/modules/ticket/front/tracking/index/index.html b/modules/ticket/front/tracking/index/index.html
index 269fe23ac..3252385a8 100644
--- a/modules/ticket/front/tracking/index/index.html
+++ b/modules/ticket/front/tracking/index/index.html
@@ -28,7 +28,7 @@
{{::tracking.worker.user.nickname | dashIfEmpty}}
- {{::tracking.created | date:'dd/MM/yyyy HH:mm'}}
+ {{::tracking.created | dateTime:'dd/MM/yyyy HH:mm'}}
diff --git a/modules/travel/front/index/index.html b/modules/travel/front/index/index.html
index 744b0680d..c649d24fb 100644
--- a/modules/travel/front/index/index.html
+++ b/modules/travel/front/index/index.html
@@ -39,10 +39,10 @@
{{::travel.ref}}
{{::travel.agency.name}}
{{::travel.warehouseOut.name}}
- {{::travel.shipped | date:'dd/MM/yyyy'}}
+ {{::travel.shipped | dateTime:'dd/MM/yyyy'}}
{{::travel.warehouseIn.name}}
- {{::travel.landed | date:'dd/MM/yyyy'}}
+ {{::travel.landed | dateTime:'dd/MM/yyyy'}}