kizitonwose / Calendar

A highly customizable calendar view and compose library for Android.
MIT License
4.5k stars 492 forks source link

FirstDayOfMonth with out and in dates #508

Closed mak1nt0sh closed 7 months ago

mak1nt0sh commented 7 months ago

Is it possible to set first day of month for compose? Also retaining the In and Out days? To achieve calendar like this:

Screenshot_20231111-192155

kizitonwose commented 7 months ago
    val state = rememberCalendarState(
        startMonth = startMonth,
        endMonth = endMonth,
        firstVisibleMonth = currentMonth,
        firstDayOfWeek = firstDayOfWeek,
        outDateStyle = EndOfGrid, // This is what you need
    )
mak1nt0sh commented 7 months ago

But how do I set 15 day as the first of the month? I can only set the day of week. Like in image example.

kizitonwose commented 7 months ago

Calendars do not work like that. You can't force a day to be the first in every month.

mak1nt0sh commented 7 months ago

There are use cases for financial periods. It's not a first day of month but more like a displayed date range from middle of the month to next one.

Say i.e. you get your salary on 15th and want to plot a calendar of expenses till the next salary.

kizitonwose commented 7 months ago

I get you now, you want to remove all the days before a certain date on the calendar. That is currently not possible.