Back to Trending
RepositoryVue
ZestfulNation

ZestfulNation/vue-hotel-datepicker

A VueJS v3 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.

837stars
207forks
1issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: calendar

#1 Repository of the month

1
TINIX TRENDING·Topic: datepicker

#1 Repository of the month

1
TINIX TRENDING·Topic: datepicker-component

#1 Repository of the month

npm

A responsive date range picker for Vue.js that displays the number of nights selected and allow several useful options like custom check-in/check-out rules, localization support and more.

demo gif

Demo

https://ZestfulNation.github.io/vue-hotel-datepicker/

Installation

Note: Since v5.0.0 this component requires Vue 3 (vue: ^3.4.0). If you're on Vue 2, use vue-hotel-datepicker@4.x.

NPM

npm install vue-hotel-datepicker

PNPM

pnpm install vue-hotel-datepicker

YARN

yarn add vue-hotel-datepicker
import HotelDatePicker from 'vue-hotel-datepicker'
import 'vue-hotel-datepicker/dist/vueHotelDatepicker.css';

export default {
  components: {
    HotelDatePicker,
  },
}
<HotelDatePicker :modelValue="true" />

Props/Options

NameTypeDefaultDescription
modelValueBooleanfalseThe v-model prop, controls the visibility of the date picker. (This is a breaking change with v4)
alwaysVisibleBooleanfalseIf true shows display calendar in the page without an input.
bookingsArray[]If you want to show bookings.
closeDatepickerOnClickOutsideBooleantrueCloses the date picker when the user clicks outside the date picker.
disableCheckoutOnCheckinBooleanfalseIf set to true, disable checkout on the same date has checkin.
disabledDatesArray[]An array of strings in this format: YYYY-MM-DD. All the dates passed to the list will be disabled.
disabledDaysOfWeekArray[]DEPRECATED: An array of strings in this format: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']. All the days passed to the list will be disabled. It depends on the translated names.
disabledWeekDaysObject{}An object with the following properties: sunday, monday, tuesday, wednesday, thursday, friday, saturday, the value indicates if that day is disabled (true) or enabled (false).
displayClearButtonBooleantrueIf set to true, displays a clear button on the right side of the input if there are dates set.
enableCheckoutBooleanfalseIf true, allows the checkout on a disabled date.
endDate[Date, String, Number]InfinityThe end view date. All the dates after this date will be disabled.
endingDateValueDatenullThe initial value of the end date.
firstDayOfWeekNumber0The first day of the week. Where Sun = 0, Mon = 1, ... Sat = 6. You need to set the right order in i18n.day-names too.
formatString'YYYY-MM-DD'The date format string.
gridStyleBooleantrueIf false hides the grid around the days.
halfDayBooleantrueAllows to have half a day, if you have check in at noon and checkout before noon
hoveringTooltip[Boolean, Function]trueShows a tooltip with the number of nights when hovering a date.
i18nObjectsee belowHolds the traslation of the date picker.
lastDateAvailable[Number, Date]InfinityAllows to stop calendar pagination after the month of that date
maxNightsNumbernullMaximum nights required to select a range of dates. 0 or null for no limit.
minNightsNumber1Minimum nights required to select a range of dates.
periodDatesArray[]If you want to have specific startAt and endAt period with different duration or price or type of period. See below for more information
positionRightBooleanfalseIf true shows the calendar on the right of the input.
priceDecimalsNumber0The price decimals for weekly periods (see periodDates).
priceSymbolString''The price symbol added before the price when showPrice is true and a price has been set in one of the periodDates array items (period).
showPriceBooleanfalseIf set to true, displays a price contains on your periodDates.
showSingleMonthBooleanfalseIf set to true, display one month only.
showWeekNumbersBooleanfalseIf set to true, displays the week numbers.
showYearBooleantrueShows the year next to the month.
singleDaySelectionBooleanfalseWhen true only one day can be selected instead of a range.
startDate[Date, String]new Date()The start view date. All the dates before this date will be disabled.
startingDateValueDatenullThe initial value of the start date.
tooltipMessageStringnullIf provided, it will override the default tooltip "X nights" with the text provided. You can use HTML in the string.
yearBeforeMonthBooleanfalseShow the year before the month, only when showYear is true.

i18n Defaults:

i18n: {
  "night": "Night",
  "nights": "Nights",
  "week": "week",
  "weeks": "weeks",
  "day-names": ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"],
  "check-in": "Check-in",
  "check-out": "Check-out",
  "month-names": [
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
      "September",
      "October",
      "November",
      "December",
  ],
  "tooltip": {
      "halfDayCheckIn": "Available CheckIn",
      "halfDayCheckOut": "Available CheckOut",
      "saturdayToSaturday": "Only Saturday to Saturday",
      "sundayToSunday": "Only Sunday to Sunday",
      "minimumRequiredPeriod": "%{minNightInPeriod} %{night} minimum.",
  },
}

periodDates

  • Type: Array
  • Default: [] If you want to have specific startAt and endAt period with different duration or price or type of period-
KeyTypeDescription
endAtStringYYYY-MM-DD
startAtStringYYYY-MM-DD
minimumDurationNumberMinimum stay (Type: weekly => per_week | Type: nightly => per night)
periodTypeStringnightly, weekly_by_saturday, weekly_by_sunday
priceFloatPrice displayed on each day for this period

Example:

periodDates: [
  {
    startAt: "2020-06-09",
    endAt: "2020-07-26",
    minimumDuration: 4,
    periodType: "nightly"
  },
  {
    startAt: "2020-07-26",
    endAt: "2020-09-30",
    minimumDuration: 1,
    periodType: "weekly_by_saturday"
  },
  {
    startAt: "2020-09-30",
    endAt: "2020-11-30",
    minimumDuration: 2,
    periodType: "weekly_by_sunday",
    price: 4000.0
  }
],

MinimumDuration with a periodType weekly-~ equals to a week

bookings

If you want to show bookings

  • Type: Array
  • Default: []
KeyTypeDescription
checkInDateString'YYYY-MM-DD'
checkOutDateString'YYYY-MM-DD'
styleObjectStyle, (see the example)

Example:

bookings: [
  {
    event: true,
    checkInDate: "2020-08-26",
    checkOutDate: "2020-08-29",
    style: {
      backgroundColor: "#399694"
    }
  },
  {
    event: false,
    checkInDate: "2020-07-01",
    checkOutDate: "2020-07-08",
    style: {
      backgroundColor: "#9DC1C9"
    }
  }
],

Methods

⚠️ In order to open/close the datepicker from an external element, such as a button make sure to set closeDatepickerOnClickOutside to false

NameDescription
hideDatepickerHides the datepicker
showDatepickerShows the datepicker
toggleDatepickerToggles (shows or hides) the datepicker

Events

NameParams enumDescription
booking-clickedMouseEvent, Date, ObjectEmitted every time a booking is clicked. The first param is the mouse javascript event, the second is the clicked Date and the third is the clicked booking.
check-in-changedEmitted every time a new check in date is selected with the new date as payload.
check-out-changedEmitted every time a new check out date is selected with the new date as payload.
clear-selectionEmitted every time you clicked on clear Date button.
day-clickedDate, String, Date|Number|StringEmitted every time when day is clicked. The params are clicked: date, format and next disabled date.
handle-checkin-checkout-half-dayObjectEmitted on [beforeMount, clear-selection, checkout]. Param: Object of checkin-checkout date.
next-month-renderedEmitted every time the next month is rendered.
period-selectedEvent, Date, DateEmitted every time when a checkOut is clicked. Params: Mouse Event, checkIn, checkOut

booking-clicked examples

{
  checkInDate: "YYYY-MM-DD",
  checkOutDate: "YYYY-MM-DD",
  style: {
    backgroundColor: "#399694",
  }
}

Credits

This component was originally built as a Vue wrapper component for the Hotel Datepicker by @benitolopez. Version 2.0.0 was completely rewritten with Vue, removing the original library, removing some features and introducing others.

Similar Projects

Discover other similar projects and AI models.

RepositoryVue
zxwk1998/vue-admin-better

🎉 vue admin,vue3 admin,vue3.0 admin,vue后台管理,vue-admin,vue3.0-admin,admin,vue-admin,vue-element-admin,ant-design,vab admin pro,vab admin plus,vue admin plus,vue admin pro

18.9k
Nov 8, 2026
RepositoryVue
DavidHDev/vue-bits

An open source collection of animated, interactive & fully customizable Vue components for building stunning, memorable websites.

4.7k
Nov 19, 2026
RepositoryVue
v1Labs/protovue

A prototyping component library

193
May 29, 2018
RepositoryTypeScript
Akryum/vue-virtual-scroller

⚡️ Blazing fast scrolling for any amount of data

10.8k
Oct 24, 2026
RepositoryVue
ElemeFE/element

A Vue.js 2.0 UI Toolkit for Web

54.0k
Aug 20, 2024
RepositoryVue
nextcloud-libraries/nextcloud-vue

🍱 Vue.js components for Nextcloud app development ✌ https://npmjs.org/@nextcloud/vue

246
Nov 26, 2026
RepositoryVue
337547038/Vue-UI-for-PC

基于Vue2.x的一套PC端UI组件,包括了Carousel 跑马灯、Cascader 级联、Checkbox 多选框、Collapse 折叠面板、DatePicker 日期选择、Dialog 对话框、Form 表单、Input 输入框、InputNumber 数字输入框、Layer 弹窗层、Loading 加载、Menu 菜单、Page 分页、Progress 进度条、Radio 单选框、SelectDropDown 仿select、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 文字提示、BackTop 返回顶部、steps 步骤条、Transfer 穿梭框、Tree 树形、Upload 文件上传、Lazy 图片懒加载、Loading 加载、Pagination 分页等等

194
Dec 9, 2022
RepositoryTypeScript
hoppscotch/hoppscotch

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

81.0k
Nov 27, 2026
RepositoryJavaScript
dcloudio/uni-app

A cross-platform framework using Vue.js

41.7k
Nov 28, 2026