Compare commits
1 Commits
master
...
fix-how-lo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57cb6e8eaf |
@@ -196,12 +196,12 @@ const getUnlockEntryForReservation = (reservation, previousReservation) => {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const { memberId, resourceId } = reservation;
|
const { memberId, resourceId } = reservation;
|
||||||
|
|
||||||
const previousReservationEndMoment = previousReservation && previousReservation.end ?
|
const previousReservationStartMoment = previousReservation && previousReservation.start ?
|
||||||
moment.utc(previousReservation.end) : null;
|
moment.utc(previousReservation.start) : null;
|
||||||
const reservationStartMoment = moment.utc(reservation.start);
|
const reservationStartMoment = moment.utc(reservation.start);
|
||||||
|
|
||||||
const fromTimestamp = previousReservationEndMoment && previousReservationEndMoment.tz(UI_TIMEZONE).isSame(reservationStartMoment.tz(UI_TIMEZONE), 'day') ?
|
const fromTimestamp = previousReservationStartMoment && previousReservationStartMoment.tz(UI_TIMEZONE).isSame(reservationStartMoment.tz(UI_TIMEZONE), 'day') ?
|
||||||
previousReservation.end : reservationStartMoment.tz(UI_TIMEZONE).startOf('day').toISOString();
|
previousReservation.start : reservationStartMoment.tz(UI_TIMEZONE).startOf('day').toISOString();
|
||||||
|
|
||||||
const toTimestamp = reservation.end;
|
const toTimestamp = reservation.end;
|
||||||
|
|
||||||
@@ -314,13 +314,13 @@ const getLockEntryForReservation = (reservation, nextReservation) => {
|
|||||||
|
|
||||||
const attributes = ['memberName', 'event', 'timestamp'];
|
const attributes = ['memberName', 'event', 'timestamp'];
|
||||||
|
|
||||||
const nextReservationStartMoment = nextReservation && nextReservation.start ?
|
const nextReservationEndMoment = nextReservation && nextReservation.end ?
|
||||||
moment.utc(nextReservation.start) : null;
|
moment.utc(nextReservation.end) : null;
|
||||||
const reservationStartMoment = moment.utc(reservation.start);
|
const reservationStartMoment = moment.utc(reservation.start);
|
||||||
|
|
||||||
const fromTimestamp = reservation.start;
|
const fromTimestamp = reservation.start;
|
||||||
const toTimestamp = nextReservationStartMoment && nextReservationStartMoment.tz(UI_TIMEZONE).isSame(reservationStartMoment.tz(UI_TIMEZONE), 'day') ?
|
const toTimestamp = nextReservationEndMoment && nextReservationEndMoment.tz(UI_TIMEZONE).isSame(reservationStartMoment.tz(UI_TIMEZONE), 'day') ?
|
||||||
nextReservation.start : reservationStartMoment.tz(UI_TIMEZONE).endOf('day').toISOString();
|
nextReservation.end : reservationStartMoment.tz(UI_TIMEZONE).endOf('day').toISOString();
|
||||||
|
|
||||||
const filters = {
|
const filters = {
|
||||||
memberId,
|
memberId,
|
||||||
|
|||||||
@@ -368,7 +368,10 @@ const getIncidentData = (reservation) => {
|
|||||||
const { resourceId } = currentReservation;
|
const { resourceId } = currentReservation;
|
||||||
|
|
||||||
// const reservationMoment = moment.tz(currentReservation.start, currentReservation.timezone);
|
// const reservationMoment = moment.tz(currentReservation.start, currentReservation.timezone);
|
||||||
// if (currentReservation.memberId === '5ce785af422bdd00967fb781' && reservationMoment.isAfter('2019-11-23 00:00:16+00')) {
|
// if (currentReservation.memberId === '5ce785af422bdd00967fb781' &&
|
||||||
|
// reservationMoment.isAfter('2019-12-11 00:00:16+00') &&
|
||||||
|
// reservationMoment.isBefore('2019-12-12 23:59:59')
|
||||||
|
// ) {
|
||||||
// console.log('\r\n\r\n==== ANALYSE RESERVATION [GET INCIDENT DATA] ==== ');
|
// console.log('\r\n\r\n==== ANALYSE RESERVATION [GET INCIDENT DATA] ==== ');
|
||||||
// console.log('\tStart : ', reservationMoment.format('DD.MM, HH:mm'));
|
// console.log('\tStart : ', reservationMoment.format('DD.MM, HH:mm'));
|
||||||
// console.log('\tEnd : ', moment.tz(currentReservation.end, currentReservation.timezone).format('DD.MM, HH:mm'));
|
// console.log('\tEnd : ', moment.tz(currentReservation.end, currentReservation.timezone).format('DD.MM, HH:mm'));
|
||||||
|
|||||||
Reference in New Issue
Block a user