Merge pull request #693 from sharetribe/fix-daily-breakdown-unit-count

Fix breakdown unit count in daily bookings
This commit is contained in:
Kimmo Puputti 2018-02-07 10:59:34 +02:00 committed by GitHub
commit c407ed0bcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
import React from 'react';
import { FormattedMessage, FormattedHTMLMessage, FormattedDate } from 'react-intl';
import moment from 'moment';
import { LINE_ITEM_NIGHT, propTypes } from '../../util/types';
import { LINE_ITEM_NIGHT, LINE_ITEM_DAY, propTypes } from '../../util/types';
import { daysBetween } from '../../util/dates';
import css from './BookingBreakdown.css';
@ -42,7 +42,7 @@ const LineItemBookingPeriod = props => {
const { start: startDate, end: endDateRaw } = booking.attributes;
const isNightly = unitType === LINE_ITEM_NIGHT;
const isDaily = unitType === LINE_ITEM_NIGHT;
const isDaily = unitType === LINE_ITEM_DAY;
const dayCount = daysBetween(startDate, endDateRaw);
const isSingleDay = !isNightly && dayCount === 1;