@@ -241,43 +241,43 @@ private long computeNextScheduledExecutionTimeStartingAt(long startTime) {
241241 * Computes the next time that this weekly scheduled action is supposed to be
242242 * executed starting at startTime.
243243 *
244- * If no weekdays have been set (GnuCash desktop allows it), it will return a
244+ * If no days of the week have been set (GnuCash desktop allows it), it will return a
245245 * date in the future to ensure ScheduledActionService doesn't execute it.
246246 *
247247 * @param startTime LocalDateTime to use as start to compute the next schedule.
248248 *
249- * @return Next run time as a LocalDateTime. A date in the future, if no weekdays
249+ * @return Next run time as a LocalDateTime. A date in the future, if no days of the week
250250 * were set in the Recurrence.
251251 */
252252 @ NonNull
253253 private LocalDateTime computeNextWeeklyExecutionStartingAt (LocalDateTime startTime ) {
254254 if (mRecurrence .getByDays ().isEmpty ())
255255 return LocalDateTime .now ().plusDays (1 ); // Just a date in the future
256256
257- // Look into the week of startTime for another scheduled weekday
258- for (int weekDay : mRecurrence .getByDays () ) {
259- int jodaWeekDay = convertCalendarWeekdayToJoda ( weekDay );
260- LocalDateTime candidateNextDueTime = startTime .withDayOfWeek (jodaWeekDay );
257+ // Look into the week of startTime for another scheduled day of the week
258+ for (int dayOfWeek : mRecurrence .getByDays () ) {
259+ int jodaDayOfWeek = convertCalendarDayOfWeekToJoda ( dayOfWeek );
260+ LocalDateTime candidateNextDueTime = startTime .withDayOfWeek (jodaDayOfWeek );
261261 if (candidateNextDueTime .isAfter (startTime ))
262262 return candidateNextDueTime ;
263263 }
264264
265- // Return the first scheduled weekday from the next due week
266- int firstScheduledWeekday = convertCalendarWeekdayToJoda (mRecurrence .getByDays ().get (0 ));
265+ // Return the first scheduled day of the week from the next due week
266+ int firstScheduledDayOfWeek = convertCalendarDayOfWeekToJoda (mRecurrence .getByDays ().get (0 ));
267267 return startTime .plusWeeks (mRecurrence .getMultiplier ())
268- .withDayOfWeek (firstScheduledWeekday );
268+ .withDayOfWeek (firstScheduledDayOfWeek );
269269 }
270270
271271 /**
272- * Converts a java.util.Calendar weekday constant to the
272+ * Converts a java.util.Calendar day of the week constant to the
273273 * org.joda.time.DateTimeConstants equivalent.
274274 *
275- * @param calendarWeekday weekday constant from java.util.Calendar
276- * @return weekday constant equivalent from org.joda.time.DateTimeConstants
275+ * @param calendarDayOfWeek day of the week constant from java.util.Calendar
276+ * @return day of the week constant equivalent from org.joda.time.DateTimeConstants
277277 */
278- private int convertCalendarWeekdayToJoda (int calendarWeekday ) {
278+ private int convertCalendarDayOfWeekToJoda (int calendarDayOfWeek ) {
279279 Calendar cal = Calendar .getInstance ();
280- cal .set (Calendar .DAY_OF_WEEK , calendarWeekday );
280+ cal .set (Calendar .DAY_OF_WEEK , calendarDayOfWeek );
281281 return LocalDateTime .fromCalendarFields (cal ).getDayOfWeek ();
282282 }
283283
0 commit comments