chrisdavies / tiny-date-picker

A small, modern, dependency-free date picker
https://chrisdavies.github.io/tiny-date-picker/
415 stars 87 forks source link

Is it possible to display months vertically? #57

Closed gety9 closed 6 years ago

gety9 commented 6 years ago

As title says i am wondering If it's possible to display months vertically?

Something like this?

chrisdavies commented 6 years ago

No, that's not really possible right now without some major work.

I like that UI, though. It looks like it only shows a single year's worth of months?

One thing I've thought about doing at some point is exposing more of the internals of tiny-date-picker, so you could easily use its generative functions to generate your own UI. But right now, it's all hidden.

Best, -C-

gety9 commented 6 years ago

Chris

Could you advise how it can be achieved?

Maybe we can try create instances for each month and place them vertically?

chrisdavies commented 6 years ago

Yeah. Exactly what you're saying. You could render multiple calendars (say, one for each month, rendered in permanent mode) into a scrollable div. You'd have to manage the pagination / animation, etc.

That would work, especially if you're only showing a year at a time. If you want infinite scroll, that would be more challenging, but could also be done. I did something similar recently with a PDF / image renderer.

gety9 commented 6 years ago

Thank you for quick reply

Performance wise we should not see issues for 6-12 months(calendars), right?

chrisdavies commented 6 years ago

I doubt it. The only way to know is to test it!

The more I think about it, though, the more I think if you really want that UI experience, it might be better to roll your own. You'd have to do a lot of hacks (I think) in order to make this work smoothly with this library. Essentially, you'd be using this library only as a calendar generator, which is a simple enough task to build on your own without the weight of this lib.