ZestfulNation / vue-hotel-datepicker

A VueJS v2 responsive date range picker. Displays the number of nights selected and allow several useful options like custom check-in/check-out rules, localization support and more.
https://zestfulnation.github.io/vue-hotel-datepicker/
MIT License
840 stars 220 forks source link

Date Format on Mobile View #302

Closed besart-rr closed 2 years ago

besart-rr commented 3 years ago

Describe the bug Date Format is not working as expected on mobile view, as I passed the prop with the format I want, we can see that format on inputs, but not after a drawer is opened, the dates on top of the drawer still are in the default format

To Reproduce Steps to reproduce the behavior:

  1. Set the format you want for inputs
  2. Click on the inputs to open the date picker for mobile view
  3. Check the dates on top of the drawer

Expected behavior We should see the same format as we pass on props, or we need another prop for this on to be formated on mobile view

I checked the source code and saw this https://github.com/krystalcampioni/vue-hotel-datepicker/blob/bb12abce4a799f8033afaa50ccb2dfe179566542/src/DatePicker/HotelDatePicker.vue#L64

I think it should be calling this method: {{ `${checkIn ? formatDate(checkIn) : i18n['check-in']}` }}

or with parameters

{{ `${checkIn ? dateFormater(checkIn, format) : i18n['check-in']}` }}

Screenshots