How to do create, manipulate, and send to API an array of dates

Hello Xano experts,

My simple API queries all entries from Measurements database for a user-defined time interval (e.g., a month). Now I need this (or another) API to additionally return a list of dates for all Mondays within this interval (say, list_of_mondays). Measurements may not be available for all days within this interval or for all Mondays.

How to create such a new variable / list of Mondays for a given calendar month? I guess this should be a function that looks from start_date till end_date of a given month and checks if the current date is Monday. How to build it? I hope I can do without Lambda.

Second, what should be the format of the API output to include this additional list of Mondays - json with Measurement list AND an array of Mondays?

Thanks!

4 replies