File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,13 +66,15 @@ export class PlaysController extends Controller {
6666 * Retrieve all plays for a given UTC date
6767 * @param date Required date filter in ISO 8601 format (YYYY-MM-DD)
6868 * @param shootingPlaysOnly Optional filter to only return shooting plays
69+ * @param utcOffset Optional UTC offset in hours to adjust the date range
6970 */
7071 @Get ( 'date' )
7172 public async getPlaysByDate (
7273 @Query ( ) date : Date ,
7374 @Query ( ) shootingPlaysOnly ?: boolean ,
75+ @Query ( ) utcOffset ?: number ,
7476 ) : Promise < PlayInfo [ ] > {
75- return await getPlaysByDate ( date , shootingPlaysOnly ) ;
77+ return await getPlaysByDate ( date , shootingPlaysOnly , utcOffset ) ;
7678 }
7779
7880 /**
Original file line number Diff line number Diff line change @@ -55,8 +55,13 @@ export const getPlaysByTournament = async (
5555export const getPlaysByDate = async (
5656 date : Date ,
5757 shootingPlaysOnly ?: boolean ,
58+ utcOffset ?: number ,
5859) : Promise < PlayInfo [ ] > => {
5960 const endRange = new Date ( date ) ;
61+ if ( utcOffset ) {
62+ date . setHours ( date . getHours ( ) + utcOffset ) ;
63+ }
64+
6065 endRange . setDate ( date . getDate ( ) + 1 ) ;
6166 return await getPlays (
6267 undefined ,
You can’t perform that action at this time.
0 commit comments