Skip to content

Commit 69a0589

Browse files
committed
price styling minor fixes on previous commit
1 parent 7d330cf commit 69a0589

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

src/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
7171
<input type="checkbox" v-model="showEndingDateValue" /> endingDateValue:
7272
<input type="text" v-model="endingDate" /><br />
7373
<input type="checkbox" v-model="showPeriodDates" /> showPeriodDates<br />
74-
<input type="checkbox" v-model="showPrice" /> showPrice<br />
74+
<input type="checkbox" v-model="showPrice" /> showPrice
75+
<span v-if="showPrice">- priceSymbol: <input type="text" v-model="priceSymbol" style="width: 3em" /></span>
76+
<br />
7577
<input type="checkbox" v-model="showMinNights" :true-value="minNights" :false-value="false" /> minNights
7678
<input v-if="showMinNights !== false" type="number" v-model="minNights" min="0" /><br />
7779
<input type="checkbox" v-model="showContentSlot" /> showContentSlot<br />
@@ -88,6 +90,7 @@
8890
:showSingleMonth="showSingleMonth"
8991
:showYear="showYear"
9092
:showPrice="showPrice"
93+
:priceSymbol="priceSymbol"
9194
:yearBeforeMonth="yearBeforeMonth"
9295
:positionRight="positionRight"
9396
:singleDaySelection="singleDaySelection"

src/DatePicker/HotelDatePicker.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
:nextDisabledDate="nextDisabledDate"
129129
:nextPeriodDisableDates="nextPeriodDisableDates"
130130
:options="dayOptions"
131+
:priceSymbol="priceSymbol"
131132
:screenSize="screenSize"
132133
:showCustomTooltip="showCustomTooltip"
133134
:showPrice="showPrice"
@@ -182,6 +183,7 @@
182183
:nextDisabledDate="nextDisabledDate"
183184
:nextPeriodDisableDates="nextPeriodDisableDates"
184185
:options="dayOptions"
186+
:priceSymbol="priceSymbol"
185187
:screenSize="screenSize"
186188
:showCustomTooltip="false"
187189
:showPrice="showPrice"
@@ -486,6 +488,7 @@ export default {
486488
// eslint-disable-next-line no-nested-ternary
487489
return v1 < v2 ? -1 : v1 > v2 ? 1 : 0
488490
}
491+
489492
periodDates = [...this.periodDates].sort(sortFunction)
490493
}
491494

src/DatePicker/components/Day.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
>
2121
<div class="vhd__datepicker__month-day-wrapper">
2222
<span class="day">{{ dayNumber }}</span>
23-
<Price :show="showPrice" :price="dayPrice.price" :symbol="dayPrice.symbol" />
23+
<Price :show="showPrice" :price="dayPrice" :symbol="priceSymbol" />
2424
</div>
2525
</div>
2626
<BookingBullet
@@ -115,6 +115,10 @@ export default {
115115
options: {
116116
type: Object,
117117
},
118+
priceSymbol: {
119+
type: String,
120+
required: true,
121+
},
118122
screenSize: {
119123
type: String,
120124
default: '',
@@ -172,16 +176,15 @@ export default {
172176
return fecha.format(this.date, 'D')
173177
},
174178
dayPrice() {
175-
let result = { price: '', symbol: '' }
176-
const currentDate = this.sortedPeriodDates
177-
.revert()
179+
let result = ''
180+
const currentDate = [...this.sortedPeriodDates]
181+
.reverse()
178182
.find((d) => this.validateDateBetweenTwoDates(d.startAt, d.endAt, this.formatDate))
179183
180-
if (currentDate) {
184+
if (currentDate && currentDate.price) {
181185
const nightly = currentDate.periodType === 'nightly'
182186
183-
result.price = (currentDate.price / (nightly ? 1 : 7)).toFixed(2)
184-
result.symbol = currentDate.symbol || ''
187+
result = (currentDate.price / (nightly ? 1 : 7)).toFixed(2)
185188
}
186189
187190
return result

src/DatePicker/components/Month.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ export default {
124124
options: {
125125
type: Object,
126126
},
127+
priceSymbol: {
128+
type: String,
129+
default: '',
130+
},
127131
screenSize: {
128132
type: String,
129133
default: '',

0 commit comments

Comments
 (0)