GithubHelp home page GithubHelp logo

Comments (17)

richardtop avatar richardtop commented on June 5, 2024

Is it a duplicate of #34?

from calendarkit.

lokeshguptakiwi avatar lokeshguptakiwi commented on June 5, 2024

No..I want to set 8AM the default start time of calendar for each day. If user want to see above and below time, he can scroll up and down.

from calendarkit.

richardtop avatar richardtop commented on June 5, 2024

Would scrollTo method of the dayView solve your issue?
https://github.com/richardtop/CalendarKit/blob/master/Sources/DayView.swift#L140

Just try using it like this:

dayView.scrollTo(hour24: 8, animated: true/false)

Let me know if this is an appropriate solution to your problem

from calendarkit.

lokeshguptakiwi avatar lokeshguptakiwi commented on June 5, 2024

yes its work..but when we click on another date ..its automatically shift to 12:00 AM.

from calendarkit.

richardtop avatar richardtop commented on June 5, 2024
  1. but when we click on another date - this is a limitation of the CalendarKit, as it doesn't preserve the scroll position when you click on the date in the header. Already reported as #211
  2. One workaround would be to invoke the dayView.scrollTo(hour24: 8, animated: true/false) method just after dayView.didMoveToDate delegate callback: https://github.com/richardtop/CalendarKit/blob/master/Sources/DayViewController.swift#L106 - let me know if this solution works for you.

from calendarkit.

lokeshguptakiwi avatar lokeshguptakiwi commented on June 5, 2024

yes, when i try to write scroll code in this method its working.. but their some jerk ...means its first show 12:00 for some millisecond then directly move to 8:00 AM

from calendarkit.

richardtop avatar richardtop commented on June 5, 2024

Could you please attach a video? Thanks

from calendarkit.

lokeshguptakiwi avatar lokeshguptakiwi commented on June 5, 2024
Screen.Recording.2023-02-27.at.3.56.14.PM.mov

Plz check in this video

from calendarkit.

richardtop avatar richardtop commented on June 5, 2024

And the exact code you're using for this? Maybe try using 'willMoveTo' instead of 'didMoveTo'? Let me know if there is any difference.
If this doesn't help, I'll convert this ticket to an enhancement.

from calendarkit.

lokeshguptakiwi avatar lokeshguptakiwi commented on June 5, 2024

No , when i move that line to willMoveTo..then nothing are happing.

from calendarkit.

richardtop avatar richardtop commented on June 5, 2024

And do you use animated:false with didMoveTo?

from calendarkit.

lokeshguptakiwi avatar lokeshguptakiwi commented on June 5, 2024

yes on didMoveTo and same on willMoveTo.

from calendarkit.

richardtop avatar richardtop commented on June 5, 2024

Ok, I've changed this to enhancement. Would you be willing to make relevant changes to the CalendarKit to implement this feature?

I can briefly explain how to achieve this functionality.

from calendarkit.

lokeshguptakiwi avatar lokeshguptakiwi commented on June 5, 2024

yes if you will help me..i will make changes.

from calendarkit.

richardtop avatar richardtop commented on June 5, 2024

Looks like this will need quite a big refactoring to make it posible. Unfortunately, CK doesn't keep the scroll position in the case of selecting a date via the header.

Please take a look at this code, as you see, the scrollToFirstEventIfNeeded() is executed on completion, so there will be some animation going on:
https://github.com/richardtop/CalendarKit/blob/master/Sources/Timeline/TimelinePagerView.swift#L446

I suggest for your case just use the method I've suggested, but with the animated:true parameter. It won't make it unnoticeable, although it will make the interface feel a bit more pleasing.

from calendarkit.

lokeshguptakiwi avatar lokeshguptakiwi commented on June 5, 2024

oky..let me check this one..Thanks

from calendarkit.

richardtop avatar richardtop commented on June 5, 2024

Please keep me updated on whether you resolve this issue either by my suggestion or by any other means...

from calendarkit.

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.