Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

ReservationInfoQV - minor changes

DanielŻuławskic2d9f144cf33
diff --git a/src/Web/Grand.Web/Views/Shared/_ReservationInfoQV.cshtml b/src/Web/Grand.Web/Views/Shared/_ReservationInfoQV.cshtml
index 26c76642b..3e551cda2 100644
--- a/src/Web/Grand.Web/Views/Shared/_ReservationInfoQV.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/_ReservationInfoQV.cshtml
@@ -13,17 +13,17 @@
<template v-if="PopupQuickViewVueModal.IntervalUnit == 10">
<div>
<h5>@Loc["Products.Reservation.DateFrom"]:</h5>
- <input :name="'reservationDatepickerFrom_' + PopupQuickViewVueModal.Id" id="reservationDatepickerFrom" class="form-control datepicker" />
+ <input :name="'reservationDatepickerFrom_' + PopupQuickViewVueModal.Id" id="reservationDatepickerFrom" class="form-control datepicker" v-model="PopupQuickViewVueModal.RentalStartDateUtc" />
</div>
<div>
<h5>@Loc["Products.Reservation.DateTo"]:</h5>
- <input :name="'reservationDatepickerTo_' + PopupQuickViewVueModal.Id" id="reservationDatepickerTo" class="form-control datepicker" />
+ <input :name="'reservationDatepickerTo_' + PopupQuickViewVueModal.Id" id="reservationDatepickerTo" class="form-control datepicker" v-model="PopupQuickViewVueModal.RentalEndDateUtc" />
</div>
</template>
<template v-else>
<div>
<h5>@Loc["Products.Reservation.Date"]:</h5>
- <input id="reservationDatepicker" class="form-control datepicker" />
+ <input id="reservationDatepicker" class="form-control datepicker" v-model="PopupQuickViewVueModal.RentalStartDateUtc" />
</div>
<div>
<h5 style="margin-top:10px">@Loc["Products.Reservation.Hour"]:</h5>
diff --git a/src/Web/Grand.Web/wwwroot/theme/script/app.js b/src/Web/Grand.Web/wwwroot/theme/script/app.js
index b7f60f342..5038d54be 100644
--- a/src/Web/Grand.Web/wwwroot/theme/script/app.js
+++ b/src/Web/Grand.Web/wwwroot/theme/script/app.js
@@ -306,6 +306,19 @@
}
})
},
+ formatDate(date) {
+ var d = new Date(date),
+ month = '' + (d.getMonth() + 1),
+ day = '' + d.getDate(),
+ year = d.getFullYear();
+
+ if (month.length < 2)
+ month = '0' + month;
+ if (day.length < 2)
+ day = '0' + day;
+
+ return [month, day, year].join('/');
+ },
QuickViewShown: function () {
if (vm.PopupQuickViewVueModal.ProductAttributes.length > 0) {
vm.attrchange(vm.PopupQuickViewVueModal.Id, vm.PopupQuickViewVueModal.HasCondition, true)
@@ -315,6 +328,12 @@
vm.attrchange(vm.PopupQuickViewVueModal.Id, vm.PopupQuickViewVueModal.HasCondition, true)
}
}
+ if (vm.PopupQuickViewVueModal.ProductType == 20) {
+ var StartDate = this.formatDate(vm.PopupQuickViewVueModal.RentalStartDateUtc);
+ var EndDate = this.formatDate(vm.PopupQuickViewVueModal.RentalEndDateUtc);
+ vm.PopupQuickViewVueModal.RentalStartDateUtc = StartDate;
+ vm.PopupQuickViewVueModal.RentalEndDateUtc = EndDate;
+ }
}
},
});