Giter VIP home page Giter VIP logo

Comments (19)

mbaev avatar mbaev commented on May 29, 2024 1

Thanks! Please, take this one: https://jsfiddle.net/t0zxjd07/2/

from pickmeup.

nazar-pc avatar nazar-pc commented on May 29, 2024

Yep, I thought about this.
If you'll fix this faster than me, please, don't hesitate to send pull request.

from pickmeup.

goranovs avatar goranovs commented on May 29, 2024

+1 on fixing that "feature"

from pickmeup.

Nadoedalo avatar Nadoedalo commented on May 29, 2024

Also it has weird behavior on month select - it lets to pick january of the next year without changing the current year

from pickmeup.

EHLOVader avatar EHLOVader commented on May 29, 2024

+1 I would like to prevent this abrupt changing.

I also would like to make the current date be in the first calendar instead of the center or second one.

from pickmeup.

EHLOVader avatar EHLOVader commented on May 29, 2024

Have a branch with part of the solution. It handles left and right alignment in addition to the default center alignment of the current selection.

It doesn't however handle completely static. You will always be shifted left or right but at least you can control which direction.

left align is best for times when you would want to primarily choose a future date.
right align is best for times when you would want to choose past dates.
center the default, would be best for selecting any surrounding date, within the prior or coming months.

Here is the branch. https://github.com/EHLOVader/PickMeUp/tree/calendar-alignment

Currently I don't see a smooth path to completely static where the months stay in place and don't move on each selection. But this is certainly a start.

from pickmeup.

nazar-pc avatar nazar-pc commented on May 29, 2024

@EHLOVader, centered should be better just center, but what static means?

from pickmeup.

EHLOVader avatar EHLOVader commented on May 29, 2024

Ah, that makes sense. I didn't give center much thought. It wouldn't ever require any explicit configuration. It was the default and I just needed to name it.

static is the last name I thought of, after left and right. It was a desired behavior not yet represented by the others. The idea would be no monthly movement whatsoever. This is likely the actual solution needed to fix the problems mentioned initially in this issue.

The only possible movement I think would make sense in static mode would be moving back or forward if selecting a date from the month just prior or after the shown dates. A not-in-month date.

Perhaps there would be a better name for that.

I couldn't see how it could be done though. Not easily like refactoring the alignment. I tried a bit and ended up with the days and month navigation off from each other.

from pickmeup.

nazar-pc avatar nazar-pc commented on May 29, 2024

I think that should become just default behavior. I mean it shouldn't move anything anywhere implicitly, and alignment should have an effect on initialization or after hide/show cycle. In all other cases month switching will require to click arrow.

from pickmeup.

EHLOVader avatar EHLOVader commented on May 29, 2024

My proposed static you mean? Certainly. I agree. Almost.

Multi month view

If you select June 2nd in this situation what would you have it do if static was chosen?

I still think it would be logical to move forward at least one month.

from pickmeup.

nazar-pc avatar nazar-pc commented on May 29, 2024

I think we can eliminate static completely. If you click 2nd - it should stay at the same page, I found a bit confusing for people if calendar switches months by itself.
For instance if you'd like to choose from 31 March till 2nd June - it shouldn't switch anything automatically, let user control situation, otherwise there will be at least 2 more clicks.
Of course, we can do that configurable, but I do not think it worth such overcomplication.

from pickmeup.

EHLOVader avatar EHLOVader commented on May 29, 2024

Oh. I see. No static as a specific alignment but no assigned alignment would behave in this way.

Perfect.

I think the fringe cases like mine, which is more of a single selection scenario could be solved with events.

Now how....

from pickmeup.

EHLOVader avatar EHLOVader commented on May 29, 2024

@nazar-pc When you have a moment, check my branch I mentioned again.

I think I've got it.

No movement without alignment. If you align right selected date always moves right. Align left and it goes left. center will keep it as close to the middle as possible.

Potential exists for an initial state to be set too. Right now it is left aligned.

from pickmeup.

mbaev avatar mbaev commented on May 29, 2024

Thanks @EHLOVader! Your fix is helpful for me.
@nazar-pc Thank you for the best datepicker! I'll make "light" styles. If you want I can fork out and create PR for you. The theme based on bootstrap sass.

picjmeup-light-hover picjmeup-light

from pickmeup.

nazar-pc avatar nazar-pc commented on May 29, 2024

I'm pretty sure in every case styling is unique, but something like gallery of examples is a good idea indeed.
I'd like to have demo on jsfiddle with your styling (there is new link in readme for demo because of recent jsfiddle changes), so that I can create wiki page with links to such themes.

from pickmeup.

EHLOVader avatar EHLOVader commented on May 29, 2024

When I view it the day headers are offset. At first I thought it was just the multi month view, but it appears to be in all cases.

screenshot

from pickmeup.

mbaev avatar mbaev commented on May 29, 2024

Yes, you right. But my styles based on bootstrap and with these styles the calendar looks much better.
I attached bootstrap css.
https://jsfiddle.net/t0zxjd07/4/

from pickmeup.

nazar-pc avatar nazar-pc commented on May 29, 2024

Hi everyone here, I've worked on this issue today and it should be fixed in aad08c7.

Could you all try build from master branch before I release it (there was quite a lot changes)?

from pickmeup.

mbaev avatar mbaev commented on May 29, 2024

I can do this today about 9PM (GMT+4)

from pickmeup.

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.