Making end date inclusive for schedulable reservations
This commit is contained in:
parent
afb733608d
commit
94ddf55639
1 changed files with 6 additions and 7 deletions
|
|
@ -48,13 +48,12 @@ export class ReservationsService {
|
||||||
async getSchedulable() {
|
async getSchedulable() {
|
||||||
const query = this.reservationsRepository
|
const query = this.reservationsRepository
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.where(
|
.where(`DATE(dateRangeStart) >= DATE(:startDate)`, {
|
||||||
`DATE(dateRangeStart) BETWEEN DATE(:startDate) AND DATE(:endDate)`,
|
startDate: dayjs().add(1, 'days').toISOString(),
|
||||||
{
|
})
|
||||||
startDate: dayjs().add(1, 'days').toISOString(),
|
.andWhere(`DATE(dateRangeStart) <= DATE(:endDate)`, {
|
||||||
endDate: dayjs().add(7, 'days').toISOString(),
|
endDate: dayjs().add(7, 'days').toISOString(),
|
||||||
},
|
})
|
||||||
)
|
|
||||||
.andWhere('status = :status', {
|
.andWhere('status = :status', {
|
||||||
statuses: ReservationStatus.Pending,
|
statuses: ReservationStatus.Pending,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue