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

The selection of the year 1924 and below does not work #455

Open
rozhkovs opened this issue Feb 13, 2025 · 2 comments
Open

The selection of the year 1924 and below does not work #455

rozhkovs opened this issue Feb 13, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@rozhkovs
Copy link

Current behaviour

When you select a year earlier than 1925, artifacts appear on the interface, and it is impossible to scroll back.

Expected behaviour

The calendar displays correctly and allows scrolling both left and right.

How to reproduce?

Run the example on iOS or Android. Select the year 1900.

Preview

Simulator.Screen.Recording.-.iPhone.16.-.2025-02-13.at.16.21.55.mp4

What have you tried so far?

If you increase the number export const startAtIndex = 1200 to 4000, the issue disappears.

Your Environment

software version
ios 18.1
android 15
react-native 76
react-native-paper ^5.12.5
node 21
npm or yarn 4
expo sdk 52
@rozhkovs rozhkovs added the bug Something isn't working label Feb 13, 2025
@rozhkovs
Copy link
Author

rozhkovs commented Feb 13, 2025

My patch
diff --git a/lib/module/Date/dateUtils.js b/lib/module/Date/dateUtils.js
index de45771c070a4d7cd0f0e871110ca087f0bcdc49..98bebf99fd96872e8a18dcf6c03263600f4351a6 100644
--- a/lib/module/Date/dateUtils.js
+++ b/lib/module/Date/dateUtils.js
@@ -108,7 +108,7 @@ export function isLeapYear({
 }
 export const daySize = 46;
 export const estimatedMonthHeight = 360;
-export const startAtIndex = 1200;
+export const startAtIndex = 2000; // https://github.com/web-ridge/react-native-paper-dates/issues/455
 export const totalMonths = startAtIndex * 2;
 export const beginOffset = estimatedMonthHeight * startAtIndex;
 export const gridCounts = new Array(totalMonths);
diff --git a/src/Date/dateUtils.tsx b/src/Date/dateUtils.tsx
index 5356889422ed2c8fd95b3d5baddc1b934f516bbf..9d9f4eef388b8cc9184786d8cc61edfc7f4bf4ed 100644
--- a/src/Date/dateUtils.tsx
+++ b/src/Date/dateUtils.tsx
@@ -170,7 +170,7 @@ export function isLeapYear({ year }: { year: number }) {

 export const daySize = 46
 export const estimatedMonthHeight = 360
-export const startAtIndex = 1200
+export const startAtIndex = 2000 // https://github.com/web-ridge/react-native-paper-dates/issues/455
 export const totalMonths = startAtIndex * 2
 export const beginOffset = estimatedMonthHeight * startAtIndex
 export const gridCounts = new Array<number | undefined>(totalMonths)

@iM-GeeKy
Copy link
Collaborator

PRs are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants