Comments (19)
Thanks! Please, take this one: https://jsfiddle.net/t0zxjd07/2/
from pickmeup.
Yep, I thought about this.
If you'll fix this faster than me, please, don't hesitate to send pull request.
from pickmeup.
+1 on fixing that "feature"
from pickmeup.
Also it has weird behavior on month select - it lets to pick january of the next year without changing the current year
from pickmeup.
+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.
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.
@EHLOVader, centered
should be better just center
, but what static
means?
from pickmeup.
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.
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.
My proposed static
you mean? Certainly. I agree. Almost.
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.
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.
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.
@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.
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.
from pickmeup.
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.
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.
from pickmeup.
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.
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.
I can do this today about 9PM (GMT+4)
from pickmeup.
Related Issues (20)
- How to clear input value after selecting date HOT 4
- How to add header and footer in datepicker box HOT 1
- How to disable the Selection? HOT 1
- Allow ranges using two input fields instead of one HOT 2
- Highlight dates in between range on mouse over HOT 3
- set_date should override default_date
- get_date returns 'undefined' after '.clear()'
- invalid check "date instanceof Number" HOT 2
- Incorrect calendar appearance after clearing the field HOT 2
- Disambiguation of two-digit years HOT 1
- problem in wordpress, HOT 1
- Show price label in calendar HOT 1
- Add composer.json file HOT 1
- Async userdata loading HOT 2
- Настройка календаря HOT 1
- Bootstrap update for v4 HOT 2
- Initiailise date from input HOT 8
- Add footer HOT 2
- For Two textboxes it is coming(i.e.., for the first and the fourth) and i want only for fourth one to be a date picker HOT 4
- not works for multi date inputs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pickmeup.