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