mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 12:43:11 +10:00
Day picking mode needs minumumNights to be 0
This commit is contained in:
parent
6449a8205d
commit
063d587dc5
1 changed files with 5 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ import { DateRangePicker, isInclusivelyAfterDay, isInclusivelyBeforeDay } from '
|
|||
import classNames from 'classnames';
|
||||
import moment from 'moment';
|
||||
import { START_DATE, END_DATE } from '../../util/dates';
|
||||
import * as propTypes from '../../util/propTypes';
|
||||
import config from '../../config';
|
||||
|
||||
import NextMonthIcon from './NextMonthIcon';
|
||||
|
|
@ -29,6 +30,9 @@ export const ANCHOR_LEFT = 'left';
|
|||
// value and moves on to another input within this component.
|
||||
const BLUR_TIMEOUT = 100;
|
||||
|
||||
// Minumum nights count depends on bookingUnitType (day vs night)
|
||||
const IS_DAY_PICKER = config.bookingUnitType === propTypes.LINE_ITEM_DAY;
|
||||
|
||||
// Possible configuration options of React-dates
|
||||
const defaultProps = {
|
||||
initialDates: null, // Possible initial date passed for the component
|
||||
|
|
@ -76,7 +80,7 @@ const defaultProps = {
|
|||
renderDay: day => {
|
||||
return <span className="renderedDay">{day.format('D')}</span>;
|
||||
},
|
||||
minimumNights: 1,
|
||||
minimumNights: IS_DAY_PICKER ? 0 : 1,
|
||||
enableOutsideDays: false,
|
||||
isDayBlocked: () => false,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue