Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Selection issue between december 2024 to january 2025 #2583

Open
suresheprm opened this issue Jan 5, 2025 · 5 comments
Open

Date Selection issue between december 2024 to january 2025 #2583

suresheprm opened this issue Jan 5, 2025 · 5 comments

Comments

@suresheprm
Copy link

Team,

Am using expandable calendar, before 28 december 2024, date selection is working perfectly when it comes to jan 1 2025 it disabled the previous days of 29, 30, 31. Now today 5th jan 2025 it goes to next week screen now it disabled the Jan 01, 02 ,03, 04. I set my max date is current date.

Help me to fix this issue.

Am using
"react-native": "^0.73.0",
"react": "18.2.0",
"react-native-calendars": "^1.1307.0",

Simulator Screen Shot - iPhone 13 - 2025-01-05 at 05 35 09
Screenshot 2025-01-05 at 5 45 31 AM

@mensonones
Copy link

Could you provide a repository with a minimal reproduction of the problem?

@suresheprm
Copy link
Author

<CalendarProvider date={currentDate} >
        <ExpandableCalendar
            disablePan={true}
            disableWeekScroll={true}
            format24h
            maxDate={“2025-01-05”}
            onDayPress={day => {
                setSelected(day.timestamp)
            }}
            style={{
                shadowColor: 'transparent',
                shadowOffset: { width: 0, height: 0 },
                shadowOpacity: 0,
                shadowRadius: 0,
                elevation: 0,
                width: "100%",
                backgroundColor: "#035efc",
                height: 150,
                position: "relative"
            }}

            theme={{
                selectedDayBackgroundColor: '#035efc',
                selectedDayTextColor: 'white',
                textDayFontWeight: "400",
                textMonthFontWeight: "300",
                textDayFontSize: 14,
                textMonthFontSize: 16,
            }}
           
        />
    </CalendarProvider>

@mensonones
Copy link

mensonones commented Jan 5, 2025

try this, @suresheprm

import React, { useState, useEffect } from 'react';
import { ExpandableCalendar, CalendarProvider } from 'react-native-calendars';

const App = () => {
  const [today, setToday] = useState('');
  const [selectedDate, setSelectedDate] = useState('');

  useEffect(() => {
    const currentDate = new Date();
    const formattedDate = currentDate.toISOString().split('T')[0];
    setToday(formattedDate);
    setSelectedDate(formattedDate);
  }, []);

  return (
    today && (
      <CalendarProvider date={selectedDate}>
          <ExpandableCalendar
            firstDay={1}
            markedDates={{
              [selectedDate]: { selected: true, marked: true, disableTouchEvent: false },
            }}
            theme={{
              selectedDayBackgroundColor: '#00adf5',
              todayTextColor: '#00adf5',
              dayTextColor: '#2d4150',
              textDisabledColor: '#d9e1e8',
              dotColor: '#00adf5',
              selectedDotColor: '#ffffff',
              arrowColor: '#00adf5',
              monthTextColor: '#00adf5',
            }}
            disableAllTouchEventsForDisabledDays={true} // Evitar interação com dias desabilitados
            allowShadow={false}
          />
      </CalendarProvider>
    )
  );
};

export default App;

@suresheprm
Copy link
Author

Thanks for the reply @mensonones,

There is no luck after update your code. Still the error is same. Jan 01, 02, 03, 04 are disabled.
Simulator Screen Shot - iPhone 13 - 2025-01-07 at 08 49 32

@mensonones
Copy link

mensonones commented Jan 7, 2025

WhatsApp Image 2025-01-07 at 00 32 04
WhatsApp Image 2025-01-07 at 00 32 03

Device: Samsung S23 FE - Android 14

The issue you're facing seems to be specific to iOS, and unfortunately, I don't have access to a device with the same configuration to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants