Date timezone offset properly handled from backend DB connector
gitea/salix/dev This commit has test failures Details

This commit is contained in:
Juan Ferrer 2019-10-19 01:18:25 +02:00
parent 470b966e85
commit 72017a64ac
63 changed files with 93 additions and 150 deletions

View File

@ -43,7 +43,7 @@ class DatePicker extends Field {
set field(value) {
super.field = value;
this.input.value = this.$filter('dateTime')(value, 'yyyy-MM-dd');
this.input.value = this.$filter('date')(value, 'yyyy-MM-dd');
}
}
DatePicker.$inject = ['$element', '$scope', '$compile', '$translate', '$filter'];

View File

@ -22,10 +22,10 @@ describe('Component vnDatePicker', () => {
it(`should display the formated the date`, () => {
let today;
today = new Date();
today.setUTCHours(0, 0, 0, 0);
today.setHours(0, 0, 0, 0);
$ctrl.field = today;
let displayed = $filter('dateTime')(today, 'yyyy-MM-dd');
let displayed = $filter('date')(today, 'yyyy-MM-dd');
expect($ctrl.value).toEqual(displayed);
});

View File

@ -15,7 +15,7 @@ export default class InputTime extends Field {
}
set field(value) {
this.input.value = this.$filter('dateTime')(value, 'HH:mm');
this.input.value = this.$filter('date')(value, 'HH:mm');
super.field = value;
}

View File

@ -24,7 +24,7 @@ describe('Component vnInputTime', () => {
it(`should display the formated the date`, () => {
let date = new Date();
$ctrl.field = date;
let displayed = $filter('dateTime')(date, 'HH:mm');
let displayed = $filter('date')(date, 'HH:mm');
expect($ctrl.value).toEqual(displayed);
});

View File

@ -1,21 +0,0 @@
import ngModule from '../module';
/**
* Returns a formatted date based on input filter.
*
* @return {String} The string result
*/
dateTime.$inject = ['$filter'];
export default function dateTime($filter) {
return function(input, format) {
if (typeof input === 'string' && input) {
input = new Date(input);
let offset = input.getTimezoneOffset() * 60000;
input.setTime(input.getTime() + offset);
}
return $filter('date')(input, format);
};
}
ngModule.filter('dateTime', dateTime);

View File

@ -1,7 +1,6 @@
import './phone';
import './ucwords';
import './dash-if-empty';
import './dateTime';
import './percentage';
import './currency';
import './zero-fill';

View File

@ -5,37 +5,6 @@ const EnumFactory = require('loopback-connector-mysql').EnumFactory;
const fs = require('fs');
class VnMySQL extends MySQL {
toColumnValue(prop, val) {
if (val == null || !prop || prop.type !== Date)
return MySQL.prototype.toColumnValue.call(this, prop, val);
val = new Date(val);
return val.getFullYear() + '-' +
fillZeros(val.getMonth() + 1) + '-' +
fillZeros(val.getDate()) + ' ' +
fillZeros(val.getHours()) + ':' +
fillZeros(val.getMinutes()) + ':' +
fillZeros(val.getSeconds());
function fillZeros(v) {
return v < 10 ? '0' + v : v;
}
}
fromColumnValue(prop, val) {
if (val == null || !prop || prop.type !== Date)
return MySQL.prototype.fromColumnValue.call(this, prop, val);
let date = new Date(val);
return date;
}
isIsoDate(dateString) {
let isoRegexp = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/g;
return isoRegexp.test(dateString);
}
/**
* Promisified version of execute().
*

View File

@ -12,6 +12,8 @@
"username": "root",
"password": "root",
"multipleStatements": true,
"legacyUtcDateProcessing": false,
"timezone": "local",
"connectTimeout": 20000,
"acquireTimeout": 20000
},

View File

@ -40,10 +40,6 @@ module.exports = Self => {
where: {id}
}, options);
const hour = zone.hour;
const offset = hour.getTimezoneOffset() * 60000;
hour.setTime(hour.getTime() + offset);
// Find all original included geolocations
const includedGeo = await models.ZoneIncluded.find({
fields: ['geoFk', 'isIncluded'],

View File

@ -31,7 +31,7 @@
value="{{$ctrl.zone.agencyMode.name}}">
</vn-label-value>
<vn-label-value label="Closing hour (ETD)"
value="{{$ctrl.zone.hour | dateTime: 'HH:mm'}}">
value="{{$ctrl.zone.hour | date: 'HH:mm'}}">
</vn-label-value>
<vn-label-value label="Traveling days"
value="{{$ctrl.zone.travelingDays}}">

View File

@ -15,13 +15,13 @@
<div
ng-if="::row.from && !row.to"
class="vn-mb-sm">
{{::row.from | dateTime:'dd/MM/yyyy'}}
{{::row.from | date:'dd/MM/yyyy'}}
</div>
<div
ng-if="::!row.from || row.to"
class="vn-mb-sm">
<span ng-if="row.to">
{{::row.from | dateTime:'dd/MM/yyyy'}} - {{::row.to | dateTime:'dd/MM/yyyy'}}
{{::row.from | date:'dd/MM/yyyy'}} - {{::row.to | date:'dd/MM/yyyy'}}
</span>
<span ng-if="!row.to" translate>
Indefinitely
@ -32,7 +32,7 @@
</div>
<vn-label-value
label="Closing"
value="{{::row.hour | dateTime:'hh:mm'}}">
value="{{::row.hour | date:'hh:mm'}}">
</vn-label-value>
<vn-label-value
label="Traveling days"

View File

@ -7,7 +7,7 @@
<vn-table>
<vn-tbody>
<vn-tr ng-repeat="row in data | orderBy:'day'">
<vn-td>{{::row.day | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::row.day | date:'dd/MM/yyyy'}}</vn-td>
<vn-td shrink>
<vn-icon-button
icon="delete"

View File

@ -39,7 +39,7 @@
<vn-td number>{{::zone.id}}</vn-td>
<vn-td expand>{{::zone.name}}</vn-td>
<vn-td>{{::zone.agencyMode.name}}</vn-td>
<vn-td shrink>{{::zone.hour | dateTime: 'HH:mm'}}</vn-td>
<vn-td shrink>{{::zone.hour | date: 'HH:mm'}}</vn-td>
<vn-td number>{{::zone.price | currency: 'EUR':2}}</vn-td>
<vn-td shrink>
<vn-horizontal class="buttons">

View File

@ -4,8 +4,9 @@
filter="::$ctrl.filter">
</vn-crud-model>
<div class="vn-w-md">
<vn-card class="vn-px-lg">
<vn-searchbar auto-load="false"
<vn-card class="vn-pa-md">
<vn-searchbar
auto-load="false"
on-search="$ctrl.onSearch($params)"
vn-focus>
</vn-searchbar>

View File

@ -14,7 +14,7 @@
</vn-one>
<vn-one>
<vn-label-value label="Closing hour (ETD)"
value="{{$ctrl.summary.hour | dateTime: 'HH:mm'}}">
value="{{$ctrl.summary.hour | date: 'HH:mm'}}">
</vn-label-value>
<vn-label-value label="Traveling days"
value="{{$ctrl.summary.travelingDays}}">

View File

@ -92,7 +92,7 @@
on-change="$ctrl.setClaimDestination(saleClaimed.id, value)">
</vn-autocomplete>
</vn-td>
<vn-td>{{::saleClaimed.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::saleClaimed.sale.ticket.landed | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::saleClaimed.sale.quantity}}</vn-td>
<vn-td expand>{{::saleClaimed.sale.concept}}</vn-td>
<vn-td number>{{::saleClaimed.sale.price | currency: 'EUR':2}}</vn-td>
@ -145,7 +145,7 @@
class="clickable"
ng-click="$ctrl.addClaimedSale(sale.saleFk)">
<vn-td number>{{sale.saleFk}}</vn-td>
<vn-td>{{sale.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{sale.landed | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{sale.quantity}}</vn-td>
<vn-td expand>{{sale.concept}}</vn-td>
<vn-td number>{{sale.price | currency: 'EUR':2}}</vn-td>
@ -182,7 +182,7 @@
ng-repeat="ticket in lastTickets"
ng-click="$ctrl.importTicketLines(ticket.id)">
<vn-td number>{{::ticket.id}}</vn-td>
<vn-td>{{::ticket.shipped | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::ticket.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::ticket.agencyMode.name}}</vn-td>
<vn-td>{{::ticket.warehouse.name}}</vn-td>
</vn-tr>

View File

@ -17,7 +17,7 @@
<vn-textfield
vn-one
label="Created"
field="::$ctrl.claim.created | dateTime:'yyyy-MM-dd hh:mm'"
field="::$ctrl.claim.created | date:'yyyy-MM-dd hh:mm'"
readonly="true">
</vn-textfield>
</vn-horizontal>

View File

@ -27,7 +27,7 @@
value="{{$ctrl.claim.claimState.description}}">
</vn-label-value>
<vn-label-value label="Created"
value="{{$ctrl.claim.created | dateTime: 'dd/MM/yyyy HH:mm'}}">
value="{{$ctrl.claim.created | date: 'dd/MM/yyyy HH:mm'}}">
</vn-label-value>
<vn-label-value label="Salesperson"
value="{{$ctrl.claim.client.salesPerson.user.nickname}}">

View File

@ -34,7 +34,7 @@
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="saleClaimed in $ctrl.salesClaimed" vn-repeat-last>
<vn-td center>{{::saleClaimed.sale.ticket.landed | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td center>{{::saleClaimed.sale.ticket.landed | date:'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::saleClaimed.sale.quantity}}</vn-td>
<vn-td>
<vn-input-number
@ -99,7 +99,7 @@
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="sale in $ctrl.salesToClaim" class="clickable" ng-click="$ctrl.addClaimedSale($index)">
<vn-td number>{{sale.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{sale.landed | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{sale.quantity}}</vn-td>
<vn-td expand title="{{::sale.concept}}">
<span

View File

@ -41,7 +41,7 @@
{{::claim.name}}
</span>
</vn-td>
<vn-td center>{{::claim.created | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td center>{{::claim.created | date:'dd/MM/yyyy'}}</vn-td>
<vn-td expand>
<span
class="link"

View File

@ -7,7 +7,7 @@
<vn-horizontal>
<vn-one>
<vn-label-value label="Created"
value="{{$ctrl.summary.claim.created | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.summary.claim.created | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="State"
value="{{$ctrl.summary.claim.claimState.description}}">
@ -66,7 +66,7 @@
{{::saleClaimed.sale.itemFk | zeroFill:6}}
</span>
</vn-td>
<vn-td>{{::saleClaimed.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::saleClaimed.sale.ticket.landed | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::saleClaimed.sale.quantity}}</vn-td>
<vn-td number>{{::saleClaimed.quantity}}</vn-td>
<vn-td expand>{{::saleClaimed.sale.concept}}</vn-td>
@ -157,7 +157,7 @@
</span>
</vn-td>
<vn-td expand>{{::action.claimBeggining.description}}</vn-td>
<vn-td number>{{::action.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::action.sale.ticket.landed | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::action.sale.quantity}}</vn-td>
<vn-td expand>{{::action.sale.concept}}</vn-td>
<vn-td number>{{::action.sale.price}}</vn-td>

View File

@ -62,13 +62,13 @@
<vn-tbody>
<vn-tr ng-repeat="balance in $ctrl.balances">
<vn-td>
<span title="{{::balance.payed | dateTime:'dd/MM/yyyy'}}">
{{::balance.payed | dateTime:'dd/MM/yyyy'}}
<span title="{{::balance.payed | date:'dd/MM/yyyy'}}">
{{::balance.payed | date:'dd/MM/yyyy'}}
</span>
</vn-td>
<vn-td>
<span title="{{::balance.created | dateTime:'dd/MM/yyyy HH:mm'}}">
{{::balance.created | dateTime:'dd/MM/yyyy HH:mm'}}
<span title="{{::balance.created | date:'dd/MM/yyyy HH:mm'}}">
{{::balance.created | date:'dd/MM/yyyy HH:mm'}}
</span>
</vn-td>
<vn-td>

View File

@ -19,8 +19,8 @@
</vn-icon-button>
</vn-none>
<vn-one class="border-solid-right">
<div><vn-label translate>Since</vn-label> {{::classification.started | dateTime:'dd/MM/yyyy'}}</div>
<div><vn-label translate>To</vn-label> {{classification.finished | dateTime:'dd/MM/yyyy'}}</div>
<div><vn-label translate>Since</vn-label> {{::classification.started | date:'dd/MM/yyyy'}}</div>
<div><vn-label translate>To</vn-label> {{classification.finished | date:'dd/MM/yyyy'}}</div>
</vn-one>
<vn-vertical vn-one class="vn-px-md">
<vn-horizontal ng-repeat="insurance in classification.insurances track by insurance.id">
@ -36,7 +36,7 @@
</vn-one>
<vn-one>
<vn-label-value label="Date"
value="{{::insurance.created | dateTime:'dd/MM/yyyy' }}">
value="{{::insurance.created | date:'dd/MM/yyyy' }}">
</vn-label-value>
</vn-one>
</vn-horizontal>

View File

@ -19,7 +19,7 @@
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="insurance in insurances">
<vn-td>{{::insurance.created | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::insurance.created | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::insurance.grade}}</vn-td>
<vn-td number>{{::insurance.credit | currency: 'EUR': 2}}</vn-td>
</vn-tr>

View File

@ -22,7 +22,7 @@
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="credit in credits track by credit.id">
<vn-td>{{::credit.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::credit.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::credit.worker.user.nickname}}</vn-td>
<vn-td number>{{::credit.amount | currency:'EUR':2}}</vn-td>
</vn-tr>

View File

@ -70,7 +70,7 @@
{{::document.dms.worker.user.nickname | dashIfEmpty}}
</span></vn-td>
<vn-td>
{{::document.dms.created | dateTime:'dd/MM/yyyy HH:mm'}}
{{::document.dms.created | date:'dd/MM/yyyy HH:mm'}}
</vn-td>
<vn-td shrink>
<a target="_blank"

View File

@ -36,7 +36,7 @@
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="greuge in greuges">
<vn-td>{{::greuge.shipped | dateTime:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td>{{::greuge.shipped | date:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td>{{::greuge.description}}</vn-td>
<vn-td>{{::greuge.greugeType.name}}</vn-td>
<vn-td number>{{::greuge.amount | currency: 'EUR': 2}}</vn-td>

View File

@ -27,8 +27,8 @@
<vn-td number>{{::mandate.id}}</vn-td>
<vn-td>{{::mandate.company.code}}</vn-td>
<vn-td>{{::mandate.mandateType.name}}</vn-td>
<vn-td>{{::mandate.created | dateTime:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td>{{::mandate.finished | dateTime:'dd/MM/yyyy HH:mm' || '-'}}</vn-td>
<vn-td>{{::mandate.created | date:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td>{{::mandate.finished | date:'dd/MM/yyyy HH:mm' || '-'}}</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>

View File

@ -15,7 +15,7 @@
class="note vn-pa-sm border-solid border-radius vn-mb-md">
<vn-horizontal class="vn-mb-sm" style="color: #666">
<vn-one>{{::note.worker.user.nickname}}</vn-one>
<vn-auto>{{::note.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-auto>
<vn-auto>{{::note.created | date:'dd/MM/yyyy HH:mm'}}</vn-auto>
</vn-horizontal>
<vn-horizontal class="text">
{{::note.text}}

View File

@ -33,8 +33,8 @@
ng-click="$ctrl.setFinished(recovery)">
</vn-icon-button>
</vn-td>
<vn-td>{{::recovery.started | dateTime:'dd/MM/yyyy' }}</vn-td>
<vn-td>{{recovery.finished | dateTime:'dd/MM/yyyy' }}</vn-td>
<vn-td>{{::recovery.started | date:'dd/MM/yyyy' }}</vn-td>
<vn-td>{{recovery.finished | date:'dd/MM/yyyy' }}</vn-td>
<vn-td number>{{::recovery.amount | currency: 'EUR': 0}}</vn-td>
<vn-td number>{{::recovery.period}}</vn-td>
</vn-tr>

View File

@ -23,7 +23,7 @@
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="sample in samples">
<vn-td>{{::sample.created | dateTime:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td>{{::sample.created | date:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td
title="{{::sample.type.description}}">
{{::sample.type.description}}

View File

@ -192,7 +192,7 @@
</vn-label-value>
<vn-vertical ng-if="$ctrl.summary.recovery.started">
<vn-label-value label="Recovery since"
value="{{$ctrl.summary.recovery.started | dateTime:'dd/MM/yyyy'}}">
value="{{$ctrl.summary.recovery.started | date:'dd/MM/yyyy'}}">
</vn-label-value>
</vn-vertical>
</vn-one>

View File

@ -36,7 +36,7 @@
</vn-icon>
</vn-td>
<vn-td number>{{::transaction.id}}</vn-td>
<vn-td>{{::transaction.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::transaction.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td number>{{::transaction.amount | currency: 'EUR':2}}</vn-td>
<vn-td shrink>
<vn-icon-button

View File

@ -21,7 +21,7 @@
<div class="attributes">
<h5>{{$ctrl.invoiceOut.ref}}</h5>
<vn-label-value label="Date"
value="{{$ctrl.invoiceOut.issued | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.invoiceOut.issued | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Import"
value="{{$ctrl.invoiceOut.amount | currency: 'EUR': 2}}">

View File

@ -37,7 +37,7 @@
class="clickable vn-tr searchResult"
ui-sref="invoiceOut.card.summary({id: {{::invoiceOut.id}}})">
<vn-td>{{::invoiceOut.ref | dashIfEmpty}}</vn-td>
<vn-td>{{::invoiceOut.issued | dateTime:'dd/MM/yyyy' | dashIfEmpty}}</vn-td>
<vn-td>{{::invoiceOut.issued | date:'dd/MM/yyyy' | dashIfEmpty}}</vn-td>
<vn-td number>{{::invoiceOut.amount | currency: 'EUR': 2 | dashIfEmpty}}</vn-td>
<vn-td>
<span
@ -46,9 +46,9 @@
{{::invoiceOut.clientSocialName | dashIfEmpty}}
</span>
</vn-td>
<vn-td>{{::invoiceOut.created | dateTime:'dd/MM/yyyy' | dashIfEmpty}}</vn-td>
<vn-td>{{::invoiceOut.created | date:'dd/MM/yyyy' | dashIfEmpty}}</vn-td>
<vn-td>{{::invoiceOut.companyCode | dashIfEmpty}}</vn-td>
<vn-td>{{::invoiceOut.dued | dateTime:'dd/MM/yyyy' | dashIfEmpty}}</vn-td>
<vn-td>{{::invoiceOut.dued | date:'dd/MM/yyyy' | dashIfEmpty}}</vn-td>
<vn-td>
<vn-icon-button
ng-show="invoiceOut.hasPdf"

View File

@ -3,16 +3,16 @@
<vn-horizontal>
<vn-one>
<vn-label-value label="Date"
value="{{$ctrl.summary.invoiceOut.issued | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.summary.invoiceOut.issued | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Due"
value="{{$ctrl.summary.invoiceOut.dued | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.summary.invoiceOut.dued | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Created"
value="{{$ctrl.summary.invoiceOut.created | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.summary.invoiceOut.created | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Booked"
value="{{$ctrl.summary.invoiceOut.booked | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.summary.invoiceOut.booked | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Company"
value="{{$ctrl.summary.invoiceOut.company.code | dashIfEmpty}}">
@ -66,7 +66,7 @@
{{ticket.nickname}}
</span>
</vn-td>
<vn-td>{{ticket.shipped | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{ticket.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{ticket.total | currency: 'EUR': 2}}</vn-td>
</vn-tr>
</vn-tbody>

View File

@ -43,7 +43,7 @@
<vn-td expand>
<span class="chip"
ng-class="::{warning: $ctrl.isToday(sale.date)}">
{{::sale.date | dateTime:'dd/MM/yyyy' }}
{{::sale.date | date:'dd/MM/yyyy' }}
</span>
</vn-td>
<vn-td number>

View File

@ -44,7 +44,7 @@
</vn-check>
</vn-td>
<vn-td>{{entry.warehouse| dashIfEmpty}}</vn-td>
<vn-td>{{entry.landed | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{entry.landed | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td number>{{entry.entryFk | dashIfEmpty}}</vn-td>
<vn-td number>{{entry.price2 | dashIfEmpty}}</vn-td>
<vn-td number>{{entry.price3 | dashIfEmpty}}</vn-td>

View File

@ -8,7 +8,7 @@
</vn-crud-model>
<form name="form">
<div class="vn-ma-md">
<vn-card class="vn-px-md vn-list">
<vn-card class="vn-pa-md vn-list">
<vn-horizontal>
<vn-searchbar
auto-load="false"
@ -47,9 +47,9 @@
</span>
</vn-td>
<vn-td>
<span title="{{::request.shipped | dateTime: 'dd/MM/yyyy'}}"
<span title="{{::request.shipped | date: 'dd/MM/yyyy'}}"
class="chip {{$ctrl.compareDate(request.shipped)}}">
{{::request.shipped | dateTime: 'dd/MM/yyyy'}}
{{::request.shipped | date: 'dd/MM/yyyy'}}
</span>
</vn-td>
<vn-td>{{::request.warehouse}}</vn-td>

View File

@ -31,7 +31,7 @@
value="{{$ctrl.order.client.salesPerson.user.nickname}}">
</vn-label-value>
<vn-label-value label="Landed"
value="{{$ctrl.order.landed | dateTime: 'dd/MM/yyyy' }}">
value="{{$ctrl.order.landed | date: 'dd/MM/yyyy' }}">
</vn-label-value>
<vn-label-value label="Agency"
value="{{$ctrl.order.agencyMode.name}}">

View File

@ -55,7 +55,7 @@
</vn-check>
</vn-td>
<vn-td>{{::order.sourceApp}}</vn-td>
<vn-td center>{{::order.created | dateTime: 'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td center>{{::order.created | date: 'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td center>{{::order.landed | date:'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::order.companyCode}}</vn-td>
<vn-td number>{{::order.total | currency: 'EUR': 2 | dashIfEmpty}}</vn-td>

View File

@ -48,7 +48,7 @@
</vn-fetched-tags>
</vn-td>
<vn-td>{{::row.warehouse.name}}</vn-td>
<vn-td>{{::row.shipped | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::row.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::row.quantity}}</vn-td>
<vn-td number>
{{::row.price | currency: 'EUR':2}}

View File

@ -14,10 +14,10 @@
</vn-one>
<vn-one>
<vn-label-value label="Created"
value="{{$ctrl.summary.created | dateTime: 'dd/MM/yyyy HH:mm'}}">
value="{{$ctrl.summary.created | date: 'dd/MM/yyyy HH:mm'}}">
</vn-label-value>
<vn-label-value label="Confirmed"
value="{{$ctrl.summary.confirmed | dateTime: 'dd/MM/yyyy HH:mm'}}">
value="{{$ctrl.summary.confirmed | date: 'dd/MM/yyyy HH:mm'}}">
</vn-label-value>
<vn-label-value label="Address"
value="{{$ctrl.formattedAddress}}">

View File

@ -24,7 +24,7 @@
value="{{$ctrl.route.id}}">
</vn-label-value>
<vn-label-value label="Date"
value="{{$ctrl.route.created | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.route.created | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Agency"
value="{{$ctrl.route.agencyMode.name}}">

View File

@ -47,7 +47,7 @@
</vn-td>
<vn-td>{{::route.agencyName | dashIfEmpty}}</vn-td>
<vn-td>{{::route.vehiclePlateNumber | dashIfEmpty}}</vn-td>
<vn-td>{{::route.created | dateTime:'dd/MM/yyyy' | dashIfEmpty}}</vn-td>
<vn-td>{{::route.created | date:'dd/MM/yyyy' | dashIfEmpty}}</vn-td>
<vn-td number>{{::route.m3 | dashIfEmpty}}</vn-td>
<vn-td>{{::route.description | dashIfEmpty}}</vn-td>
<vn-td>

View File

@ -6,7 +6,7 @@
value="{{$ctrl.summary.route.id}}">
</vn-label-value>
<vn-label-value label="Date"
value="{{$ctrl.summary.route.created | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.summary.route.created | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Agency"
value="{{$ctrl.summary.route.agencyMode.name}}">
@ -23,10 +23,10 @@
</vn-one>
<vn-one>
<vn-label-value label="Starting time"
value="{{$ctrl.summary.route.time | dateTime: 'HH:MM'}}">
value="{{$ctrl.summary.route.time | date: 'HH:MM'}}">
</vn-label-value>
<vn-label-value label="Finishing time"
value="{{$ctrl.summary.route.finished | dateTime: 'HH:MM'}}">
value="{{$ctrl.summary.route.finished | date: 'HH:MM'}}">
</vn-label-value>
<vn-label-value label="Km Start"
value="{{$ctrl.summary.route.kmStart}}">

View File

@ -86,7 +86,7 @@
ng-model="$ctrl.zoneId"
vn-acl="productionBoss">
<tpl-item>
<span>{{::name}} - {{::warehouse.name}} - Max. {{::hour | dateTime: 'HH:mm'}} h.</span>
<span>{{::name}} - {{::warehouse.name}} - Max. {{::hour | date: 'HH:mm'}} h.</span>
</tpl-item>
</vn-autocomplete>
</vn-horizontal>

View File

@ -25,7 +25,7 @@
<vn-tbody>
<vn-tr ng-repeat="ticket in possibleStowaways" class="clickable" ng-click="$ctrl.addStowaway(ticket)">
<vn-td number>{{ticket.id}}</vn-td>
<vn-td>{{ticket.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{ticket.landed | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{ticket.agencyMode.name}}</vn-td>
<vn-td>{{ticket.warehouse.name}}</vn-td>
<vn-td>{{ticket.state.state.name}}</vn-td>

View File

@ -33,7 +33,7 @@
value="{{$ctrl.ticket.client.salesPerson.user.nickname}}">
</vn-label-value>
<vn-label-value label="Shipped"
value="{{$ctrl.ticket.shipped | dateTime: 'dd/MM/yyyy HH:mm' }}">
value="{{$ctrl.ticket.shipped | date: 'dd/MM/yyyy HH:mm' }}">
</vn-label-value>
<vn-label-value label="Agency"
value="{{$ctrl.ticket.agencyMode.name}}">

View File

@ -19,7 +19,7 @@
<vn-tbody>
<vn-tr ng-repeat="stowaway in $ctrl.ticketStowaways" class="clickable" ng-click="$ctrl.showDeleteConfirm($index)">
<vn-td number>{{stowaway.id}}</vn-td>
<vn-td number>{{stowaway.ticket.landed | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{stowaway.ticket.landed | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{stowaway.ticket.agencyMode.name}}</vn-td>
<vn-td number>{{stowaway.ticket.warehouse.name}}</vn-td>
<vn-td number>{{stowaway.ticket.state.state.name}}</vn-td>

View File

@ -69,7 +69,7 @@
{{::document.dms.worker.user.nickname | dashIfEmpty}}
</span></vn-td>
<vn-td>
{{::document.dms.created | dateTime:'dd/MM/yyyy HH:mm'}}
{{::document.dms.created | date:'dd/MM/yyyy HH:mm'}}
</vn-td>
<vn-td shrink>
<a target="_blank"

View File

@ -52,7 +52,7 @@
{{::expedition.userNickname | dashIfEmpty}}
</span>
</vn-td>
<vn-td>{{::expedition.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::expedition.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>

View File

@ -101,10 +101,10 @@
</vn-td>
<vn-td>
<span class="chip {{$ctrl.compareDate(ticket.shipped)}}">
{{::ticket.shipped | dateTime: 'dd/MM/yyyy'}}
{{::ticket.shipped | date: 'dd/MM/yyyy'}}
</span>
</vn-td>
<vn-td>{{::ticket.shipped | dateTime: 'HH:mm'}}</vn-td>
<vn-td>{{::ticket.shipped | date: 'HH:mm'}}</vn-td>
<vn-td expand>
<span
class="link"
@ -121,7 +121,7 @@
<vn-td>{{::ticket.agencyMode}}</vn-td>
<vn-td>{{::ticket.warehouse}}</vn-td>
<vn-td class="expendable">{{::ticket.refFk | dashIfEmpty}}</vn-td>
<vn-td shrink>{{::ticket.zoneLanding | dateTime: 'HH:mm'}}</vn-td>
<vn-td shrink>{{::ticket.zoneLanding | date: 'HH:mm'}}</vn-td>
<vn-td number>
<span class="chip {{$ctrl.totalPriceColor(ticket)}}">
{{::ticket.total | currency: 'EUR': 2}}

View File

@ -32,7 +32,7 @@
<vn-tr ng-repeat="request in purchaseRequests">
<vn-td number>{{::request.id}}</vn-td>
<vn-td expand>{{::request.description}}</vn-td>
<vn-td number>{{::request.created | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::request.created | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td expand>
<span
class="link"

View File

@ -57,7 +57,7 @@
</span>
</vn-td>
<vn-td>{{::sale.state}}</vn-td>
<vn-td>{{::sale.created | dateTime: 'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::sale.created | date: 'dd/MM/yyyy HH:mm'}}</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>

View File

@ -320,7 +320,7 @@
ng-repeat="ticket in $ctrl.transfer.lastActiveTickets track by ticket.id"
ng-click="$ctrl.transferSales(ticket.id)">
<td number>{{::ticket.id}}</td>
<td number>{{::ticket.shipped | dateTime: 'dd/MM/yyyy'}}</td>
<td number>{{::ticket.shipped | date: 'dd/MM/yyyy'}}</td>
<td number>{{::ticket.agencyName}}</td>
<td number>{{::ticket.warehouseName}}</td>
</tr>

View File

@ -36,10 +36,10 @@
</vn-one>
<vn-one>
<vn-label-value label="Shipped"
value="{{$ctrl.summary.shipped | dateTime: 'dd/MM/yyyy HH:mm'}}">
value="{{$ctrl.summary.shipped | date: 'dd/MM/yyyy HH:mm'}}">
</vn-label-value>
<vn-label-value label="Landed"
value="{{$ctrl.summary.landed | dateTime: 'dd/MM/yyyy'}}">
value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Route"
value="{{$ctrl.summary.routeFk}}"
@ -132,7 +132,7 @@
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="package in $ctrl.summary.packagings">
<vn-td number>{{package.created | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{package.created | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{package.packaging.item.name}}</vn-td>
<vn-td number>{{package.quantity}}</vn-td>
</vn-tr>
@ -180,7 +180,7 @@
<vn-tbody>
<vn-tr ng-repeat="request in $ctrl.summary.requests">
<vn-td expand>{{::request.description}}</vn-td>
<vn-td number>{{::request.created | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td number>{{::request.created | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::request.requester.user.name}}</vn-td>
<vn-td>{{::request.atender.user.name}}</vn-td>
<vn-td number>{{::request.quantity}}</vn-td>

View File

@ -28,7 +28,7 @@
{{::tracking.worker.user.nickname | dashIfEmpty}}
</span>
</vn-td>
<vn-td>{{::tracking.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::tracking.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>

View File

@ -9,7 +9,7 @@
auto-load="true">
</vn-crud-model>
<div class="content-block">
<vn-card class="vn-px-md vn-w-sm">
<vn-card class="vn-pa-md vn-w-sm">
<vn-searchbar
vn-id="turnSearchbar"
style="width: 100%"

View File

@ -40,10 +40,10 @@
<vn-td expand>{{::travel.ref}}</vn-td>
<vn-td expand>{{::travel.agency.name}}</vn-td>
<vn-td center>{{::travel.warehouseOut.name}}</vn-td>
<vn-td center>{{::travel.shipped | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td center>{{::travel.shipped | date:'dd/MM/yyyy'}}</vn-td>
<vn-td><vn-check ng-model="travel.isDelivered" disabled="true"></vn-check></vn-td>
<vn-td>{{::travel.warehouseIn.name}}</vn-td>
<vn-td center>{{::travel.landed | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td center>{{::travel.landed | date:'dd/MM/yyyy'}}</vn-td>
<vn-td center><vn-check ng-model="travel.isReceived" disabled="true"></vn-check></vn-td>
<vn-td></vn-td>
</vn-tr>

View File

@ -34,9 +34,6 @@ module.exports = Self => {
const subordinate = await Worker.findById(data.workerFk);
const timed = new Date(data.timed);
let offset = timed.getTimezoneOffset() * 60000;
timed.setTime(timed.getTime() - offset);
return Self.rawSql('CALL vn.workerTimeControl_add(?, ?, ?, ?)', [
subordinate.userFk, null, timed, true]);
};

View File

@ -26,7 +26,7 @@
<vn-tbody>
<vn-tr ng-repeat="log in $ctrl.logs">
<vn-td>
{{::log.creationDate | dateTime:'dd/MM/yyyy HH:mm'}}
{{::log.creationDate | date:'dd/MM/yyyy HH:mm'}}
<div class="changes">
<div>
<span translate class="label">Changed by</span><span class="label">: </span>

View File

@ -27,7 +27,7 @@
icon="arrow_{{($index % 2) == 0 ? 'forward' : 'back'}}"
title="{{(($index % 2) == 0 ? 'In' : 'Out') | translate}}">
</vn-icon>
<span class="chip {{$ctrl.hourColor(hour)}}">{{hour.timed | dateTime: 'HH:mm'}}</span>
<span class="chip {{$ctrl.hourColor(hour)}}">{{hour.timed | date: 'HH:mm'}}</span>
</section>
</vn-td>
</vn-tr>