hackgvl / hackgreenville-com

HackGreenville's Website
https://hackgreenville.com
MIT License
16 stars 15 forks source link

add jump to today in calander #254

Closed alhelwany closed 3 weeks ago

alhelwany commented 4 weeks ago

This PR will fix #253

allella commented 4 weeks ago

Thanks for the start on this one.

253 should have been more specific about trying to automatically jump the calendar's view to the current day / week.

It appears 'today' was the intended value to enable the "today" button, rather than 'day' in the PR, which didn't do anything.

Having a button for the user to click to jump to the current day is somewhat useful in the month view, but only if a user has already used previous or next and wants to jump back.

Again, the hope was to automatically focus the current day / week when the page is loaded. I'll update #253 with these details.

Also, I'll note that we're still using v4 of FullCalendar.

allella commented 4 weeks ago

Perhaps the solution to auto-center / jump to the current day and week while in the dayGridMonth view is more like this solution https://stackoverflow.com/a/48100619

alhelwany commented 4 weeks ago

Thank you for responding,

The PR contains 'today' and not 'day', and it moves the calander to the current date, only if they moved right or left exactly as you mentioned.

I still don't understand the issue, are we looking for a way to have our day of the month in the center, by changing the starting day of the week? For example, if today was Monday the 8th of April 2024, should Monday be the day at the center of the calander?

alhelwany commented 4 weeks ago

Oh just kidding, I might've figured out what you're looking for. You want the calander to scroll down to the current day / week automatically?

allella commented 4 weeks ago

Yes, automatically center / jump the calendar to the current date / week? Maybe with https://fullcalendar.io/docs/Calendar-gotoDate

alhelwany commented 4 weeks ago

Hi @allella, I worked on it. The gotoDate function does not do anything regarding to scrolling down to the current date. I fixed it with a workaround by scrolling using JS. I had to add the code to the eventPositioned callback. I think a better option would've been using the resourceRender callback, but it's only available in the premium version.

allella commented 3 weeks ago

@all-contributors add @MhdGhaithAlhelwany for code

allcontributors[bot] commented 3 weeks ago

@allella

We had trouble processing your request. Please try again later.

allella commented 3 weeks ago

@all-contributors please add @MhdGhaithAlhelwany for code

allcontributors[bot] commented 3 weeks ago

@allella

We had trouble processing your request. Please try again later.

allella commented 3 weeks ago

@all-contributors please add @MhdGhaithAlhelwany for code

allcontributors[bot] commented 3 weeks ago

@allella

We had trouble processing your request. Please try again later.

allella commented 3 weeks ago

@all-contributors please add @MhdGhaithAlhelwany for code

allcontributors[bot] commented 3 weeks ago

@allella

We had trouble processing your request. Please try again later.

allella commented 3 weeks ago

@all-contributors please add @alhelwany for code

allcontributors[bot] commented 3 weeks ago

@allella

I've put up a pull request to add @alhelwany! :tada: