kiriDevs / vplanweb

A web app for the substitution plan of my school - data is supplied by an API maintained by @ChuangSheep
https://vplan.kiridevs.live
3 stars 0 forks source link

Make the date selection a dropdown instead of an entry field #39

Closed kiriDevs closed 2 years ago

kiriDevs commented 2 years ago

Help Wanted: This PR is asking for your opinions and input. See the "Help Wanted" section at the bottom of this PR's body for more information. Remember to keep discussion civil and friendly.


Original idea

Offer the next 2-3 weekdays or something like that. Prevents any errors by mis-typing dates or just not getting the format (especially since timestamps use a 2-digit-year instead of 4-digit).

Just hide weekend days, since those are irrelevant for substitution plans.

Help Wanted

ChuangSheep commented 2 years ago

Since it's impossible for us to have more than 3 vplans in the future (i haven't seen this situation at any time yet), I might just response with all future dates. And, I'd rather use GET than OPTION, but this is another topic and not that important.

kiriDevs commented 2 years ago

Yep, if you would create a response that gives me the dates that would be GET. I just would've used OPTIONS if I'd have to check for existing dates myself to reduce the amount of data transferred, since we'd only need the status code (either 404 or 200) to determine if the plan exists.

Also some way to get all existing future dates would be super convenient for this.