refs #5275 feat: colorear fechas
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-03-28 14:40:14 +02:00
parent fb1b39da17
commit b4e04fcdad
3 changed files with 66 additions and 26 deletions

View File

@ -152,18 +152,22 @@
</vn-input-number>
</td>
<td shrink-date>
<vn-date-picker
vn-one
ng-model="price.started"
on-change="$ctrl.upsertPrice(price)">
</vn-date-picker>
<vn-chip class="chip {{$ctrl.isBigger(price.started)}} transparent">
<vn-date-picker
vn-one
ng-model="price.started"
on-change="$ctrl.upsertPrice(price)">
</vn-date-picker>
</vn-chip>
</td>
<td shrink-date>
<vn-date-picker
vn-one
ng-model="price.ended"
on-change="$ctrl.upsertPrice(price)">
</vn-date-picker>
<vn-chip class="chip {{$ctrl.isLower(price.ended)}} transparent">
<vn-date-picker
vn-one
ng-model="price.ended"
on-change="$ctrl.upsertPrice(price)">
</vn-date-picker>
</vn-chip>
</td>
<td shrink>
<vn-icon-button

View File

@ -32,6 +32,28 @@ export default class Controller extends Section {
};
}
isBigger(date) {
let today = Date.vnNew();
today.setHours(0, 0, 0, 0);
date = new Date(date);
date.setHours(0, 0, 0, 0);
const timeDifference = today - date;
if (timeDifference < 0) return 'warning';
}
isLower(date) {
let today = Date.vnNew();
today.setHours(0, 0, 0, 0);
date = new Date(date);
date.setHours(0, 0, 0, 0);
const timeDifference = today - date;
if (timeDifference > 0) return 'warning';
}
add() {
if (!this.$.model.data || this.$.model.data.length == 0) {
this.$.model.data = [];

View File

@ -1,20 +1,34 @@
@import "variables";
smart-table table{
[shrink-field]{
width: 80px;
max-width: 80px;
vn-fixed-price{
smart-table table{
[shrink-field]{
width: 80px;
max-width: 80px;
}
[shrink-field-expand]{
width: 150px;
max-width: 150px;
}
}
[shrink-field-expand]{
width: 150px;
max-width: 150px;
.minPrice {
align-items: center;
text-align: center;
vn-input-number {
width: 90px;
max-width: 90px;
}
}
smart-table table tbody > * > td .chip {
padding: 0px;
}
smart-table table tbody > * > td .chip.warning {
color: $color-font-bg
}
.vn-field > .container > .infix > .control > input {
color: inherit;
}
}
.minPrice {
align-items: center;
text-align: center;
vn-input-number {
width: 90px;
max-width: 90px;
}
}