Code Monkey home page Code Monkey logo

Comments (5)

dartajax avatar dartajax commented on June 26, 2024 1

Interesting @jrjohnson - let's test some more - I think that is acceptable behavior for sure if that is the case - I would close this ticket and update the user guide and my brain.

from ilios.

jrjohnson avatar jrjohnson commented on June 26, 2024

Will need to test, but I think it starts at the time of the first offering. So if there is an 8am offering it would start there, same with 1am or 2pm.

from ilios.

stopfstedt avatar stopfstedt commented on June 26, 2024

jumping in here since Jon's working on something else - i checked our code and he's correct, the calendar will scroll to the earliest hour among given events.

from ilios.

dartajax avatar dartajax commented on June 26, 2024
video1720909924.mp4

from ilios.

stopfstedt avatar stopfstedt commented on June 26, 2024

upon further inspection, there are several things wrong with the current implementation:

  1. calculation of "earliest date", which is used to identify the scroll target. turns out that all events passed to the calendar are taken into consideration, not just the ones pertaining to the given week. for example, if the earliest event for this week starts at 10am, but last week had an event starting at 8am, then 8am is considered to be the earliest date. this can likely be fixed by applying a filter on the given events to further scope this down by just this week.
    https://github.com/ilios/common/blob/master/addon/components/weekly-calendar.js#L63
  2. the scroll-target calculation is hinky. we currently are doing this by finding the top offset of the hours-element in the calendar grid that is 2 hours before the earliest event. For example, if the earliest event starts at 10am, then the calendar attempts to scrolls to the 8am row on the Y-axis of the grid, based on the topOffset value of that element. however, this is not sufficient or perhaps incorrect altogether, since this evidently does not bring the event into view. I currently have no idea how to fix this correctly, perhaps we can fudge this further and apply a 3 hours before offset.
    https://github.com/ilios/common/blob/master/addon/components/weekly-calendar.js#L22

from ilios.

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.