fix(vnInputTime): quit new date(null)
gitea/salix/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Alex Moreno 2022-07-26 11:45:12 +02:00
parent 24f87afa51
commit d3852bac5d
3 changed files with 13 additions and 10 deletions

View File

@ -23,12 +23,15 @@ export default class InputTime extends Field {
let date = null; let date = null;
let value = this.input.value; let value = this.input.value;
if (this.field && !this.modelDate)
this.modelDate = this.field;
if (value) { if (value) {
let split = value.split(':').map(i => parseInt(i) || null); let split = value.split(':').map(i => parseInt(i) || null);
date = this.field instanceof Date date = this.modelDate
? this.field ? new Date(this.modelDate)
: new Date(this.field || null); : new Date();
date.setHours(split[0], split[1], 0, 0); date.setHours(split[0], split[1], 0, 0);
} }

View File

@ -21,7 +21,7 @@
<div>{{name}} - {{nickname}}</div> <div>{{name}} - {{nickname}}</div>
</tpl-item> </tpl-item>
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete
vn-one vn-one
ng-model="$ctrl.route.vehicleFk" ng-model="$ctrl.route.vehicleFk"
url="Vehicles" url="Vehicles"
@ -32,8 +32,8 @@
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-date-picker <vn-date-picker
vn-one vn-one
label="Created" label="Created"
ng-model="$ctrl.route.created"> ng-model="$ctrl.route.created">
</vn-date-picker> </vn-date-picker>
<vn-autocomplete <vn-autocomplete
@ -61,7 +61,7 @@
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-input-time <vn-input-time
label="Hour started" label="Hour started"
ng-model="$ctrl.route.started"> ng-model="$ctrl.route.started">
</vn-input-time> </vn-input-time>
<vn-input-time <vn-input-time
@ -71,8 +71,8 @@
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textArea <vn-textArea
vn-one vn-one
label="Description" label="Description"
ng-model="$ctrl.route.description" ng-model="$ctrl.route.description"
rule rule
vn-focus> vn-focus>

View File

@ -1,6 +1,6 @@
{ {
"name": "salix-back", "name": "salix-back",
"version": "8.6.0", "version": "8.8.0",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "Salix backend", "description": "Salix backend",
"license": "GPL-3.0", "license": "GPL-3.0",