Forum Academy Marketplace Showcase Pricing Features

Help! Calculating points based on Specific Days of Week of a Booking

I’m really struggling with how I can set up a credits/points system for Bookings based on the number and types of days within a calendar month.

An item can be booked by multiple users over a date range. e.g. the 1st to the 5th.
In order to ensure fair usage of each item, each user is allocated credits per month e.g. 200.
Mon, Tue, Wed and Thu are worth 20 points. Fri and Sat are 30 points. Sun is 50 points.

So if a user were to book an item from Thu to Sat they would use 80 points in Total of their monthly credit allocation for that item.

I’ve managed to get the days (0,1,2,3,4,5,6) a user has booked an item within a calendar month as a list.

Where I’m struggling is how to
a. assign the credits to Mon, Tue, Wed, Thu, Fri, Sat, Sun
b. calculate the total points a user has used based on their Bookings and which days of the week their bookings are for.

Any help would be greatly appreciated. This is one of the final pieces in the puzzle of my app before I can start user testing my Beta.

This topic was automatically closed after 70 days. New replies are no longer allowed.