Closed frontendtony closed 5 years ago
This should be a day
parameter, not a date
.
Better yet, month
and day
parameters. That has several benefits:
today
, then call setMonth()
and setDay()
.I have switched to using day and month parameters as advised and it does make more sense
Note that the month uses 1-based indexing (January === 1)
Good work @Tonerolima. And yeah, 1-based index for the month is definitely the way to go.
This PR sets the serverless function to use the URL date query parameter where available and to default to the current date where unavailable.
How to test
Include a date query parameter like below and it will return tweets from that particular day from previous years, up to 2016
https://europe-west1-oldtweetstoday.cloudfunctions.net/getTweetsOnThisDay?username=oghie_js&from=2019&until=2016&date=2019-1-15