- Transform the screen position to a week-based relative coordinate system.
- Convert that spatial coordinate into a time stamp represented as seconds since the epoch.
That's a minimum of two steps, two verbs and therefore two separate functions. Step 1 can be broken down further by introducing helper functions for inspecting the DOM, decoupling the representation of the UI elements from your actual screen-space coordinate system, as CSS isn't in a nicely-scriptable format.
Once you've done this, you'll discover the result to be only marginally longer, but highly reusable.