Skip to content

Correcting issue regarding Calendar.getFirstDayOfWeek() which is dependent on locale#1147

Open
alexwibowo wants to merge 1 commit intoquickfix-j:masterfrom
alexwibowo:bugfix/sessionScheduleJava21
Open

Correcting issue regarding Calendar.getFirstDayOfWeek() which is dependent on locale#1147
alexwibowo wants to merge 1 commit intoquickfix-j:masterfrom
alexwibowo:bugfix/sessionScheduleJava21

Conversation

@alexwibowo
Copy link
Contributor

@alexwibowo alexwibowo commented Feb 23, 2026

Fixes #1146

… wont start because of invalid interval date range.
Copy link
Member

@chrjohn chrjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please check if it works with these changes? We should be able to do without the added check.

Comment on lines +241 to +245

// in some cases (certain locale), we could run into scenario where the interval end is before the interval start.
if (intervalEnd.getTimeInMillis() < intervalStart.getTimeInMillis()) {
intervalEnd.add(Calendar.WEEK_OF_YEAR, 1);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// in some cases (certain locale), we could run into scenario where the interval end is before the interval start.
if (intervalEnd.getTimeInMillis() < intervalStart.getTimeInMillis()) {
intervalEnd.add(Calendar.WEEK_OF_YEAR, 1);
}

@@ -236,6 +238,11 @@ private TimeInterval theMostRecentIntervalBefore(Calendar t) {
if (intervalEnd.getTimeInMillis() <= intervalStart.getTimeInMillis()) {
intervalEnd.add(Calendar.WEEK_OF_MONTH, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
intervalEnd.add(Calendar.WEEK_OF_MONTH, 1);
intervalEnd.add(Calendar.DAY_OF_YEAR, 7);

@chrjohn chrjohn changed the title Fixing issue with newer version of Java (e.g. Java 21+) where session wont start because of invalid interval date range. Correcting issue regarding Calendar.getFirstDayOfWeek() which is dependent on locale Feb 25, 2026
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

Successfully merging this pull request may close these issues.

Issue regarding Calendar.getFirstDayOfWeek() after upgrading to Java 21+

2 participants