Closed faddalibrahim closed 2 years ago
should something be returned if the current month is neither within the fall or the spring period?
should something be returned if the current month is neither within the fall or the spring period?
yeah, great question. you know what? extend the period. Spring : January to August Fall: September to December
so that during the summer vacation , it shows results for the spring
should something be returned if the current month is neither within the fall or the spring period?
yeah, great question. you know what? extend the period. Spring : January to August Fall: September to December
so that during the summer vacation , it shows results for the spring
Alright then
There should be a way to know the current season (fall2022, spring2022 etc) whose data is supposed to be fetched
We could do that by creating a field in our database to store the current season. But it means we will have to be changing that manually at the start of every season. And also, when fetching data, we will make double calls to the database: 1, for getting the current season, 2 for fetching the data for that season
how about we create a function to determine the current season on the frontend, which we will use to determine which data to fetch from the database right away.
what do we know?
There are 2 seasons in a year: Spring (January to May) and Fall ( September to December )
We can use the Date object in javascript to do that, right? You got this!