Skip to content
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

How to scroll today when "today" button is clickedn in resourceTimelineWeek view #319

Open
derkan opened this issue Aug 28, 2024 · 2 comments

Comments

@derkan
Copy link

derkan commented Aug 28, 2024

Hi,

While at resourceTimelineWeek view, if user clicks today button, view is scrolled to start of current week. How can I make it to scroll to current day in the week?

Regards

@vkurko
Copy link
Owner

vkurko commented Aug 29, 2024

Good question. There is currently no method for such scrolling. I will try to come up with something in future versions.

@inu-web
Copy link

inu-web commented Dec 16, 2024

Maybe it helps somehow: This is what I use as a workaround at the moment for scolling to the current day in Timeline Month for example:

function scrollToDay(containerSelector, todaySelector) {
const scrollContainer = document.querySelector(containerSelector);
const todayElement = document.querySelector(todaySelector);

if (scrollContainer && todayElement) {
    const todayPosition = todayElement.offsetLeft;

    scrollContainer.scrollTo({
        left: todayPosition,
        behavior: 'smooth', 
    });
} else {
    console.error('Scroll container or day element not found.');
}

}

Usage:
scrollToToday('.ec-body', '.ec-day.ec-today');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants