fix discount date

This commit is contained in:
Bilal Catic
2019-10-04 19:51:39 +02:00
parent ef932ed36b
commit aa8931f91a

View File

@@ -228,7 +228,7 @@ const createNegativeFeeForDiscount = (memberData, dateRange) => {
const { totalBookedHours, totalChargedHours, totalBookingChargedFee } = bookingData;
const { memberId, officeId } = member;
let dateForDiscount = moment.utc().startOf('day').subtract(1, 'month').toISOString();
let dateForDiscount = moment.utc().subtract(1, 'month').startOf('month').toISOString();
if (dateRange.startDate){
dateForDiscount = moment.utc(dateRange.startDate, DEFAULT_DATE_FORMAT).startOf('month').toISOString();
}