reformat booking change incident fee description

This commit is contained in:
Bilal Catic
2019-12-16 10:29:52 +01:00
parent f36b1d6628
commit 40aef5ed30

View File

@@ -46,6 +46,8 @@ const createFeeFromIncident = (incident) => {
let bookingTimeExplanation = '';
let incidentTimeExplanation = '';
let additionalDateTimeExplanation = '';
let spacing = '';
let roomExplanation = '';
@@ -140,6 +142,7 @@ const createFeeFromIncident = (incident) => {
// dateExplanation = `${oldBookingStartMoment.clone().format('ddd, MMM DD')} -> ${newBookingStartMoment.clone().format('ddd, MMM DD')}`;
dateExplanation = `${oldBookingStartMoment.clone().format('MMM DD')}`;
bookingTimeExplanation = `[${oldBookingStartMoment.clone().format('HH:mm')} to ${oldBookingEndMoment.clone().format('HH:mm')}]`;
additionalDateTimeExplanation = ` -> ${newBookingStartMoment.clone().format('MMM DD')} [${newBookingStartMoment.clone().format('HH:mm')} to ${newBookingEndMoment.clone().format('HH:mm')}]`;
incidentTimeExplanation = `moved on : ${incidentTimestampMoment.clone().format('MMM DD, HH:mm')}`;
incidentExplanation += `, ${incidentTimeExplanation}`;
@@ -186,7 +189,7 @@ const createFeeFromIncident = (incident) => {
break;
}
const formattedName = `${officeSlug}, ${dateExplanation} ${bookingTimeExplanation}${spacing}${roomExplanation}, ${incidentExplanation}`;
const formattedName = `${officeSlug}, ${dateExplanation} ${bookingTimeExplanation}${additionalDateTimeExplanation}${spacing}${roomExplanation}, ${incidentExplanation}`;
return {
name: formattedName,