Skip to content

startDate and endDate not on a month boundary? #365

@UberJason

Description

@UberJason

Hi there,

For my current project I'm using endDate as Date() (i.e. whatever today is - currently April 1), and startDate as 2 weeks before endDate. I'm noticing that the calendar getting generated starts on March 1 even though startDate is somewhere in mid-March and generateInDates is set to .off. Wondering if this is expected behavior? Are startDate and endDate intended to be month boundaries, or is it possible to generate a calendar that starts mid-month?

Below is my configureCalendar function:

func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
        let endDate = Date()
        let startDate = endDate.subtract(2.weeks)
        
        let parameters = ConfigurationParameters(startDate: startDate,
              endDate: endDate,
             numberOfRows: 2,
            calendar: Calendar.current,
            generateInDates: .off,
            generateOutDates: .tillEndOfGrid,
            firstDayOfWeek: .sunday)

        return parameters
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions