ocf/ocfstatic

Fix Currently Open Status on Home Page

nicklitvin opened this issue · 6 comments

Currently_open wrong

Should be "Currently Closed".

Can you check the page source and add more info about this? Obviously it's not supposed to say open, but is this hardcoded or fetched dynamically?

The status is fetched dynamically.

From my understanding, there doesn't seem to be any logic to determine if the current time has passed closing time. The conditional statement only asks if the array, this.hours, has a length, which is always true unless there are no hours for that day. On Sunday, the status is "Closed" as it should be because this.hours has no length for that day.

Very interesting, I guess that was thrown together as a placeholder. Thanks for catching this, I'm surprised this wasn't raised earlier!

Wasn't there still some weird behavior going on with that? I think we saw yesterday at the meeting it wasn't quite working as expected

Yup, I figured out the issue but I'm not sure what the best way to fix it is. The problem is that sometimes this.hours isn't updated with the times the lab is open. That's why it says "Today's hours: []" since the default value for this.hours is []. Right now, I have an if statement that defaults to having the lab be closed if this happens.

In that case, your code should be fine and you were right to close this issue. Creating a separate issue to address the fact that this.hours isn't updated,