Skip to content

Commit

Permalink
Merge pull request #4747 from simfeld/fix/past-camps
Browse files Browse the repository at this point in the history
Treat camps as past only after last day is over
  • Loading branch information
carlobeltrame authored Mar 7, 2024
2 parents 24b9995 + aa1c262 commit d773dde
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/views/Camps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
</template>

<script>
import dayjs from '@/common/helpers/dayjs.js'
import { campRoute } from '@/router.js'
import { isAdmin } from '@/plugins/auth'
import ContentCard from '@/components/layout/ContentCard.vue'
Expand Down Expand Up @@ -125,12 +126,12 @@ export default {
},
upcomingCamps() {
return this.nonPrototypeCamps.filter((c) =>
c.periods().items.some((p) => new Date(p.end) > new Date())
c.periods().items.some((p) => dayjs(p.end).endOf('day').isAfter(dayjs()))
)
},
pastCamps() {
return this.nonPrototypeCamps.filter(
(c) => !c.periods().items.some((p) => new Date(p.end) > new Date())
(c) => !c.periods().items.some((p) => dayjs(p.end).endOf('day').isAfter(dayjs()))
)
},
...mapGetters({
Expand Down

0 comments on commit d773dde

Please sign in to comment.