From 87e8be0edea3f4e00392dc30ffd89f40f76eb5c6 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 27 Feb 2019 17:04:00 +0100 Subject: [PATCH 1/3] time filter changed by dateTime --- front/core/components/calendar/index.html | 8 ++++---- front/core/components/log/index.html | 2 +- modules/agency/front/descriptor/index.html | 2 +- modules/agency/front/index/index.html | 2 +- modules/agency/front/summary/index.html | 2 +- modules/claim/front/action/index.html | 2 +- modules/claim/front/index/index.html | 2 +- modules/client/front/credit-insurance/index/index.html | 6 +++--- .../front/credit-insurance/insurance/index/index.html | 2 +- modules/client/front/credit/index/index.html | 2 +- modules/client/front/greuge/index/index.html | 2 +- modules/client/front/mandate/index.html | 4 ++-- modules/client/front/note/index/index.html | 2 +- modules/client/front/recovery/index/index.html | 4 ++-- modules/client/front/sample/index/index.html | 2 +- modules/client/front/summary/index.html | 2 +- modules/item/front/diary/index.html | 2 +- modules/item/front/history/index.html | 2 +- modules/item/front/last-entries/index.html | 2 +- modules/order/front/descriptor/index.html | 2 +- modules/order/front/index/index.html | 4 ++-- modules/order/front/line/index.html | 2 +- modules/order/front/summary/index.html | 4 ++-- modules/ticket/front/descriptor/index.html | 2 +- modules/ticket/front/expedition/index.html | 2 +- modules/ticket/front/package/index.html | 2 +- modules/ticket/front/sale-tracking/index.html | 2 +- modules/ticket/front/sale/index.html | 2 +- modules/ticket/front/summary/index.html | 4 ++-- modules/ticket/front/tracking/index/index.html | 2 +- modules/travel/front/index/index.html | 4 ++-- 31 files changed, 42 insertions(+), 42 deletions(-) diff --git a/front/core/components/calendar/index.html b/front/core/components/calendar/index.html index 8fdd2e7a4..0ece00f61 100644 --- a/front/core/components/calendar/index.html +++ b/front/core/components/calendar/index.html @@ -10,8 +10,8 @@ - {{$ctrl.defaultDate | date: 'MMMM'}} - {{$ctrl.defaultDate | date: 'yyyy'}} + {{$ctrl.defaultDate | dateTime: 'MMMM'}} + {{$ctrl.defaultDate | dateTime: 'yyyy'}} @@ -78,9 +78,9 @@
- {{::day.date | date: 'd'}} + {{::day.date | dateTime: 'd'}} - {{::day.date | date: 'd'}} + {{::day.date | dateTime: 'd'}}
diff --git a/front/core/components/log/index.html b/front/core/components/log/index.html index 8211a8e08..75cbb2bbf 100644 --- a/front/core/components/log/index.html +++ b/front/core/components/log/index.html @@ -17,7 +17,7 @@ - {{::log.creationDate | date:'dd/MM/yyyy HH:mm'}} + {{::log.creationDate | dateTime:'dd/MM/yyyy HH:mm'}}
Changed by: 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 80c576ac6..4776a3dd9 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/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/index/index.html b/modules/order/front/index/index.html index b2d934ce4..53c2b2f7a 100644 --- a/modules/order/front/index/index.html +++ b/modules/order/front/index/index.html @@ -54,8 +54,8 @@ {{::order.sourceApp}} - {{::order.created | date:'dd/MM/yyyy HH:mm'}} - {{::order.landed | date:'dd/MM/yyyy'}} + {{::order.created | dateTime:'dd/MM/yyyy HH:mm'}} + {{::order.landed | dateTime:'dd/MM/yyyy'}} {{::order.company.code}} {{::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 1a93c08c1..9c8f2e716 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -229,7 +229,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'}} From 9a7bd834df401797afb67b7786535dbd377c7375 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 27 Feb 2019 17:04:32 +0100 Subject: [PATCH 2/3] date offset fixed --- .../components/date-picker/date-picker.js | 25 +++++++++++-------- front/core/filters/dateTime.js | 5 ++-- gulpfile.js | 3 +-- loopback/server/connectors/vn-mysql.js | 12 --------- modules/order/back/models/order.json | 8 +++--- modules/ticket/back/models/ticket.json | 6 ++--- 6 files changed, 25 insertions(+), 34 deletions(-) diff --git a/front/core/components/date-picker/date-picker.js b/front/core/components/date-picker/date-picker.js index e4bd24422..80a8072ad 100644 --- a/front/core/components/date-picker/date-picker.js +++ b/front/core/components/date-picker/date-picker.js @@ -28,14 +28,8 @@ class DatePicker extends Component { onValueUpdate() { if (this.vp.selectedDates.length) { let date = this.vp.selectedDates[0]; - - if (!this.isLocale && !this._iniOptions.enableTime) { - let now = new Date(); - - let offset = now.getTimezoneOffset() * 60000; - date.setHours(0, 0, 0, 0); - date.setTime(date.getTime() - offset); - } + let offset = date.getTimezoneOffset() * 60000; + date.setTime(date.getTime() - offset); this._model = date; } else this.model = null; @@ -67,8 +61,16 @@ class DatePicker extends Component { set model(value) { this._model = value; - this.dateValue = value ? new Date(value) : null; - this.vp.setDate(this.dateValue); + this.dateValue = value; + let date; + if (value && this.iniOptions.enableTime) { + date = new Date(value); + let offset = date.getTimezoneOffset() * 60000; + date.setTime(date.getTime() + offset); + } else + date = value; + + this.vp.setDate(date); this.mdlUpdate(); } @@ -84,6 +86,7 @@ class DatePicker extends Component { $onDestroy() { this.vp.destroy(); + this.dateValue = undefined; } } DatePicker.$inject = ['$element', '$scope', '$translate', '$attrs']; @@ -91,12 +94,12 @@ DatePicker.$inject = ['$element', '$scope', '$translate', '$attrs']; ngModule.component('vnDatePicker', { template: require('./date-picker.html'), bindings: { + iniOptions: ' { this.execute(query, params, options, (error, response) => { if (cb) 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/ticket/back/models/ticket.json b/modules/ticket/back/models/ticket.json index bd8917f8d..1b44745b9 100644 --- a/modules/ticket/back/models/ticket.json +++ b/modules/ticket/back/models/ticket.json @@ -13,11 +13,11 @@ "description": "Identifier" }, "shipped": { - "type": "date", + "type": "Date", "required": true }, "landed": { - "type": "date" + "type": "Date" }, "nickname": { "type": "String" @@ -32,7 +32,7 @@ "type": "Number" }, "created": { - "type": "date" + "type": "Date" }, "isDeleted": { "type": "boolean" From 5b4224147e60b20616923bc97d46a00a716928dd Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 28 Feb 2019 09:20:14 +0100 Subject: [PATCH 3/3] dates fixed --- loopback/server/datasources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loopback/server/datasources.json b/loopback/server/datasources.json index 6540c0de2..401b9483d 100644 --- a/loopback/server/datasources.json +++ b/loopback/server/datasources.json @@ -1,10 +1,10 @@ { "db": { - "connector": "memory" + "connector": "memory", + "timezone": "local" }, "vn": { "connector": "vn-mysql", - "timezone": "local", "database": "vn", "debug": false, "host": "localhost",