change fees formatting
This commit is contained in:
@@ -158,25 +158,11 @@ const createFeeFromIncident = (incident) => {
|
|||||||
roomExplanation = newResourceName || 'Unknown';
|
roomExplanation = newResourceName || 'Unknown';
|
||||||
|
|
||||||
// dateExplanation = `${oldBookingStartMoment.clone().format('ddd, MMM DD')}`;
|
// dateExplanation = `${oldBookingStartMoment.clone().format('ddd, MMM DD')}`;
|
||||||
const oldBookingDuration = oldBookingEndMoment.diff(oldBookingStartMoment, "minutes", false);
|
|
||||||
const durationInHours = Math.floor(oldBookingDuration / 60);
|
const originalBookingExplanation = `${oldBookingStartMoment.clone().format('HH:mm')} to ${oldBookingEndMoment.clone().format('HH:mm')}`;
|
||||||
const durationInMinutes = Math.floor(oldBookingDuration % 60);
|
|
||||||
let durationAsText = '';
|
|
||||||
if (durationInHours !== 0){
|
|
||||||
durationAsText += durationInHours + ' hour';
|
|
||||||
if (durationInHours === 1){
|
|
||||||
durationAsText += ' ';
|
|
||||||
}else{
|
|
||||||
durationAsText += 's ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
durationAsText += durationInMinutes + ' minute';
|
|
||||||
if (durationInMinutes > 1){
|
|
||||||
durationAsText += 's';
|
|
||||||
}
|
|
||||||
dateExplanation = `${newBookingStartMoment.clone().format('MMM DD')}`;
|
dateExplanation = `${newBookingStartMoment.clone().format('MMM DD')}`;
|
||||||
bookingTimeExplanation = `[${newBookingStartMoment.clone().format('HH:mm')} to ${newBookingEndMoment.clone().format('HH:mm')}]`;
|
bookingTimeExplanation = `[${newBookingStartMoment.clone().format('HH:mm')} to ${newBookingEndMoment.clone().format('HH:mm')}]`;
|
||||||
incidentTimeExplanation = `reservation shortened from ${durationAsText} on : ${incidentTimestampMoment.clone().format('MMM DD, HH:mm')}`;
|
incidentTimeExplanation = `reservation shortened from [${originalBookingExplanation}] on [${incidentTimestampMoment.clone().format('MMM DD, HH:mm')}]`;
|
||||||
incidentExplanation = `${incidentTimeExplanation}`;
|
incidentExplanation = `${incidentTimeExplanation}`;
|
||||||
|
|
||||||
date = incidentTimestampMoment.clone().startOf('day').format();
|
date = incidentTimestampMoment.clone().startOf('day').format();
|
||||||
|
|||||||
Reference in New Issue
Block a user