hi-manshu / Kalendar

Kalendar is a powerful and customizable calendar library for Android applications. It provides a flexible and intuitive way to display and interact with calendars in your app. With Kalendar, you can easily render calendar views, handle date selection, pagination, and range selection, and customize the layout to match your app's design.
https://www.himanshoe.com
Apache License 2.0
818 stars 66 forks source link

Date range picker feature. #43

Closed commandiron closed 2 years ago

commandiron commented 2 years ago

This pr fix this issue.

Include; kalendar-endloss package -> Kalendar kalendar package -> Kalendar (Firey), I thought Oceanic was not needed but it can be added later.

hi-manshu commented 2 years ago

@commandiron thank you for doing this. Have few Nits

  1. Chekc the Code Style
  2. Upon Selection there is a few change needed for condition check
commandiron commented 2 years ago

hi, i don't know how to do ktlint check, but i will find out and review my code again. Thank you.

hi-manshu commented 2 years ago

hi, i don't know how to do ktlint check, but i will find out and review my code again. Thank you.

Yes please do, and thank you for the effort.

gsrathoreniks commented 2 years ago

@commandiron

  1. When selected the range it should return the selected range else it'll be of no use.
commandiron commented 2 years ago

@gsrathoreniks

You're right, I'll add this. But I am not sure whether I should return the Localdate list via the onCurrentDayClick function or add a new function called onDateRange and return it from there.

And i think there is an option to just return the previous clicked day then if user wants, can calculate the days between.

gsrathoreniks commented 2 years ago

@commandiron I think returning pair of dates is better option. I think LocalDate is fine.

If we use onCurrentDayClick then the user will have to keep record of the first date selected, because when second date will be clicked it will replace the data. So it's better to pair of date with a new function.

Thought: if we make the onDateRangeSelected parameter optional then it'll be better because we won't have to add it in case we don't want to use the Range.

commandiron commented 2 years ago

I cant solve this conflict, don't know why, any help?