merge test
gitea/salix/dev This commit looks good Details

This commit is contained in:
Gerard 2019-02-28 10:19:31 +01:00
commit 7dd08dc6e5
36 changed files with 64 additions and 72 deletions

View File

@ -10,8 +10,8 @@
</vn-auto>
<vn-one>
<strong>
<span translate>{{$ctrl.defaultDate | date: 'MMMM'}}</span>
<span>{{$ctrl.defaultDate | date: 'yyyy'}}</span>
<span translate>{{$ctrl.defaultDate | dateTime: 'MMMM'}}</span>
<span>{{$ctrl.defaultDate | dateTime: 'yyyy'}}</span>
</strong>
</vn-one>
<vn-auto>
@ -78,9 +78,9 @@
<section ng-repeat="day in $ctrl.days" class="day {{day.color}}"
ng-click="$ctrl.select($index)">
<span ng-if="day.event" vn-tooltip="{{day.event.title}}">
{{::day.date | date: 'd'}}
{{::day.date | dateTime: 'd'}}
</span>
<span ng-if="!day.event">{{::day.date | date: 'd'}}</span>
<span ng-if="!day.event">{{::day.date | dateTime: 'd'}}</span>
</section>
</vn-horizontal>
</vn-vertical>

View File

@ -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: '<?',
model: '=',
label: '@?',
name: '@?',
disabled: '<?',
rule: '<?',
iniOptions: '<?',
isLocale: '<?'
},
controller: DatePicker

View File

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

View File

@ -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);
};
}

View File

@ -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...');

View File

@ -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)

View File

@ -1,6 +1,7 @@
{
"db": {
"connector": "memory"
"connector": "memory",
"timezone": "local"
},
"vn": {
"connector": "vn-mysql",

View File

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

View File

@ -36,7 +36,7 @@
<vn-td>{{::zone.name}}</vn-td>
<vn-td>{{::zone.agencyMode.name}}</vn-td>
<vn-td>{{::zone.warehouse.name}}</vn-td>
<vn-td>{{::zone.hour | date: 'HH:mm'}}</vn-td>
<vn-td>{{::zone.hour | dateTime: 'HH:mm'}}</vn-td>
<vn-td number>{{::zone.price | currency: 'EUR':2}}</vn-td>
<vn-td>
<vn-icon-button

View File

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

View File

@ -177,7 +177,7 @@
ng-repeat="ticket in lastTickets"
ng-click="$ctrl.importTicketLines(ticket.id)">
<vn-td number>{{::ticket.id}}</vn-td>
<vn-td>{{::ticket.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::ticket.shipped | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::ticket.agencyMode.name}}</vn-td>
<vn-td>{{::ticket.warehouse.name}}</vn-td>
</vn-tr>

View File

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

View File

@ -18,8 +18,8 @@
</vn-icon-button>
</vn-none>
<vn-one border-solid-right>
<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>
<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>
</vn-one>
<vn-vertical vn-one pad-medium-h>
<vn-horizontal ng-repeat="insurance in classification.insurances track by insurance.id">
@ -35,7 +35,7 @@
</vn-one>
<vn-one>
<vn-label-value label="Date"
value="{{::insurance.created | date:'dd/MM/yyyy' }}">
value="{{::insurance.created | dateTime:'dd/MM/yyyy' }}">
</vn-label-value>
</vn-one>
</vn-horizontal>

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@
margin-small-bottom>
<vn-horizontal margin-small-bottom style="color: #666">
<vn-one>{{::note.worker.user.nickname}}</vn-one>
<vn-auto>{{::note.created | date:'dd/MM/yyyy HH:mm'}}</vn-auto>
<vn-auto>{{::note.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-auto>
</vn-horizontal>
<vn-horizontal class="text">
{{::note.text}}

View File

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

View File

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

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 | date:'dd/MM/yyyy'}}">
value="{{$ctrl.summary.recovery.started | dateTime:'dd/MM/yyyy'}}">
</vn-label-value>
</vn-vertical>
</vn-one>

View File

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

View File

@ -23,7 +23,7 @@
<vn-td>{{::itemLog.description}}</vn-td>
<vn-td>{{::itemLog.action}}</vn-td>
<vn-td>{{::itemLog.user.name}}</vn-td>
<vn-td>{{::itemLog.creationDate | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::itemLog.creationDate | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>

View File

@ -45,7 +45,7 @@
</vn-check>
</vn-td>
<vn-td>{{entry.warehouse| dashIfEmpty}}</vn-td>
<vn-td>{{entry.landed | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{entry.landed | dateTime:'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

@ -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"
}

View File

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

View File

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

View File

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

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 | date: 'dd/MM/yyyy HH:mm' }}">
value="{{$ctrl.ticket.shipped | dateTime: 'dd/MM/yyyy HH:mm' }}">
</vn-label-value>
<vn-label-value label="Agency"
value="{{$ctrl.ticket.agencyMode.name}}">

View File

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

View File

@ -34,7 +34,7 @@
<vn-textfield
vn-one
label="Added"
model="package.created | date: 'dd/MM/yyyy'"
model="package.created | dateTime: 'dd/MM/yyyy'"
disabled="true"
ng-readonly="true">
</vn-textfield>

View File

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

View File

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

View File

@ -23,10 +23,10 @@
</vn-one>
<vn-one>
<vn-label-value label="Shipped"
value="{{$ctrl.summary.shipped | date: 'dd/MM/yyyy HH:mm'}}">
value="{{$ctrl.summary.shipped | dateTime: 'dd/MM/yyyy HH:mm'}}">
</vn-label-value>
<vn-label-value label="Landed"
value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy'}}">
value="{{$ctrl.summary.landed | dateTime: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Route"
value="{{$ctrl.summary.routeFk}}">

View File

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

View File

@ -39,10 +39,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 | date:'dd/MM/yyyy'}}</vn-td>
<vn-td center>{{::travel.shipped | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td><vn-check field="travel.isDelivered" disabled="true"></vn-check></vn-td>
<vn-td>{{::travel.warehouseIn.name}}</vn-td>
<vn-td center>{{::travel.landed | date:'dd/MM/yyyy'}}</vn-td>
<vn-td center>{{::travel.landed | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td center><vn-check field="travel.isReceived" disabled="true"></vn-check></vn-td>
<vn-td></vn-td>
</vn-tr>