Skip to content
Snippets Groups Projects
Commit b7b37880 authored by Håkon Eilertsen Røskaft's avatar Håkon Eilertsen Røskaft
Browse files

Clean up the view some more

parent a17474e0
No related branches found
No related tags found
1 merge request!81Renting
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
{{ item.title }} {{ item.title }}
</h1> </h1>
</div> </div>
<!-- TODO make this component render elements differently depending on screen size -->
<div <div
class="py-10 lg:pt-6 lg:pb-16 lg:col-start-1 lg:col-span-2 lg:border-r lg:border-gray-200 lg:pr-8" class="py-10 lg:pt-6 lg:pb-16 lg:col-start-1 lg:col-span-2 lg:border-r lg:border-gray-200 lg:pr-8"
> >
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
</p> </p>
</div> </div>
</div> </div>
<div class="mt-2"> <div class="mt-2 md:col-span-1">
<div class="mt-2 space-y-2"> <div class="mt-2 space-y-2">
<p class="text-xl font-semibold text-gray-900"> <p class="text-xl font-semibold text-gray-900">
Total pris: {{ totPrice }} kr Total pris: {{ totPrice }} kr
...@@ -149,18 +150,15 @@ export default { ...@@ -149,18 +150,15 @@ export default {
}, },
async getUser(userId) { async getUser(userId) {
this.userForId = await getUser(userId); this.userForId = await getUser(userId);
console.log(this.userForId);
}, },
setDate(dateOfsomthing) { setDate(dateOfsomthing) {
this.rentingStartDate = dateOfsomthing.startDate; this.rentingStartDate = dateOfsomthing.startDate;
this.rentingEndDate = dateOfsomthing.endDate; this.rentingEndDate = dateOfsomthing.endDate;
console.log("This is the two dates " + this.rentingStartDate + " " + this.rentingEndDate);
this.calculateTotPrice(); this.calculateTotPrice();
}, },
calculateTotPrice() { calculateTotPrice() {
let amountOfDays = this.rentingEndDate - this.rentingStartDate; let amountOfDays = this.rentingEndDate - this.rentingStartDate;
amountOfDays = amountOfDays / 86400000; amountOfDays = amountOfDays / 86400000;
console.log("This is the difference in days " + amountOfDays);
this.totPrice = this.item.pricePerDay * amountOfDays; this.totPrice = this.item.pricePerDay * amountOfDays;
} }
}, },
......
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
messageOnDisplay: String || "Date Input (click to open)", messageOnDisplay: String,
}, },
data() { data() {
return { return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment