-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Programs with different start/ends seem to be grid aligned #63
Comments
Super lazy note to author, and more for reference, but I solved my problem by intercepting the calculated program positions and re-writing my own width and horizontal placement function. I found that the one of original getPositionX helper functions rounds the time values unnecessarily and also contains some unnecessary branches. Effectively I replaced all of the getPositionX code with the code below: const MS_PER_HOUR = 1000 * 60 * 60;
export const getPositionX = (
since: Date,
till: Date,
startDate: Date,
endDate: Date,
hourWidth: number
) => {
// Constrain the start and end of the rendered blocks to the start and end times displayed
const renderStartTimeMs = Math.max(since.getTime(), startDate.getTime());
const renderEndTimeMs = Math.min(till.getTime(), endDate.getTime());
const diffMs = Math.max(0, renderEndTimeMs - renderStartTimeMs);
return (diffMs * hourWidth) / MS_PER_HOUR;
}; Is the rounding expected behavior currently? |
Hi @MiddleMan5 Thank you for reporting this behavior with the element in the layout. |
Planby 1.1.7
Following demo here with custom data: https://codesandbox.io/s/planby-epg-demo-ts-lp66v5
Items appear to be aligned to some kind of grid with no obvious way to change grid resolution.
The text was updated successfully, but these errors were encountered: