Skip to content

Commit

Permalink
fix: filter entries on date
Browse files Browse the repository at this point in the history
  • Loading branch information
meenahoda committed Aug 21, 2018
1 parent 0570765 commit b53be11
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module.exports = class GetAvailableDiarySlots {
const namespace = context.stateMachineMeta.namespace
const diaryService = this.services.diaries
const diary = diaryService.diaries[namespace + '_' + this.diaryId]
const entries = await this.entryModel.find({where: {'diaryId': {equals: this.diaryId}}})
let entries = await this.entryModel.find({where: {'diaryId': {equals: this.diaryId}}})
entries = entries.filter(booking => moment(event.date).format('YYYY-MM-DD') === moment(booking.startDateTime).format('YYYY-MM-DD'))

const availableTimes = getAvailableDiarySlots(diary, event.date)

Expand Down

0 comments on commit b53be11

Please sign in to comment.