Skip to content

Initial Date not working - CalendarContainer #187

@AkbarBakhshi

Description

@AkbarBakhshi

I have a very simple CalendarContainer with the bare minimum code below:

import {
  CalendarBody,
  CalendarContainer,
  CalendarHeader,
} from "@howljs/calendar-kit";
import { SafeAreaView } from "react-native-safe-area-context";
import { format } from "date-fns";

export default function RequestsScreen() {
  
  return (
    <SafeAreaView className="flex-1 bg-background">
      <CalendarContainer
        allowPinchToZoom={true}
        timeZone="America/New_York"
        numberOfDays={3} // number of days to show
        scrollByDay={false} // scroll by one day at a time - When false, it will scroll by the number of days set in numberOfDays
        minDate={format(new Date(), "yyyy-MM-dd")}
        initialDate={format(new Date(), "yyyy-MM-dd")}
      >
        <CalendarHeader />
        <CalendarBody />
      </CalendarContainer>
    </SafeAreaView>
  );
}

Today is February 21st (Friday), but the Calendar loads at February 17th (Monday). Why is this happening? initialDate is set to today.

ScreenRecording_02-21-2025.23-18-08_1.mov

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