fix timezone conversion when fetching booking reservations
This commit is contained in:
@@ -41,7 +41,7 @@ const getAllFinishedBookings = () => {
|
|||||||
const filters = {
|
const filters = {
|
||||||
canceled: false,
|
canceled: false,
|
||||||
end: {
|
end: {
|
||||||
[Op.lt]: moment.tz('UTC')
|
[Op.lt]: moment.utc().toISOString()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -56,8 +56,8 @@ const getAllFinishedBookings = () => {
|
|||||||
|
|
||||||
const getFirstNextBooking = (reservation) => {
|
const getFirstNextBooking = (reservation) => {
|
||||||
return new Promise ((resolve, reject) => {
|
return new Promise ((resolve, reject) => {
|
||||||
const {resourceId, start, timezone} = reservation;
|
const { resourceId, start } = reservation;
|
||||||
const endOfTheDay = moment.tz(start, timezone).endOf('Day').toISOString();
|
const endOfTheDay = moment.utc(start).endOf('Day').toISOString();
|
||||||
|
|
||||||
const attributes = ['reservationId', 'memberId', 'resourceId', 'start', 'end', 'timezone'];
|
const attributes = ['reservationId', 'memberId', 'resourceId', 'start', 'end', 'timezone'];
|
||||||
const filters = {
|
const filters = {
|
||||||
@@ -90,8 +90,8 @@ const getFirstNextBooking = (reservation) => {
|
|||||||
|
|
||||||
const getFirstPreviousBooking = (reservation) => {
|
const getFirstPreviousBooking = (reservation) => {
|
||||||
return new Promise ((resolve, reject) => {
|
return new Promise ((resolve, reject) => {
|
||||||
const {resourceId, start, timezone} = reservation;
|
const { resourceId, start } = reservation;
|
||||||
const startOfTheDay = moment.tz(start, timezone).startOf('Day').toISOString();
|
const startOfTheDay = moment.utc(start).startOf('Day').toISOString();
|
||||||
|
|
||||||
const attributes = ['reservationId', 'memberId', 'resourceId', 'start', 'end', 'timezone'];
|
const attributes = ['reservationId', 'memberId', 'resourceId', 'start', 'end', 'timezone'];
|
||||||
const filters = {
|
const filters = {
|
||||||
|
|||||||
Reference in New Issue
Block a user