refs #5275 feat: colorear fechas
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
fb1b39da17
commit
b4e04fcdad
|
@ -152,18 +152,22 @@
|
|||
</vn-input-number>
|
||||
</td>
|
||||
<td shrink-date>
|
||||
<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-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
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
@import "variables";
|
||||
smart-table table{
|
||||
vn-fixed-price{
|
||||
smart-table table{
|
||||
[shrink-field]{
|
||||
width: 80px;
|
||||
max-width: 80px;
|
||||
|
@ -8,13 +9,26 @@ smart-table table{
|
|||
width: 150px;
|
||||
max-width: 150px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.minPrice {
|
||||
.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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue