Code Monkey home page Code Monkey logo

Comments (6)

bentref avatar bentref commented on August 17, 2024

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?

from ocfstatic.

nicklitvin avatar nicklitvin commented on August 17, 2024

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.

from ocfstatic.

bentref avatar bentref commented on August 17, 2024

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

from ocfstatic.

bentref avatar bentref commented on August 17, 2024

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

from ocfstatic.

huytt621 avatar huytt621 commented on August 17, 2024

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.

from ocfstatic.

bentref avatar bentref commented on August 17, 2024

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,

from ocfstatic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.