jmrozanec / jmrozanec/cron-utils

Incorrect descriptor result

Open
#380 3 comments 0 reactions 0 assignees View on GitHub
bug hacktoberfest help wanted
Dominant language
Java
Stars
1.2k
Forks
272
PR merge metrics
No merged PRs in 30d

Description

Hello, @jmrozanec.
I use next cron expression 0 0 0 ? * 6 * and use class CronDescriptor.instanse(Msg.getCurrent()).describe()
I want to get at 00:00 at and Saturday day.
I get at 00:00 at and Friday days
I debug code and find that in DescriptionStrategyFactory, diff is always =-1, but if it is 0 result will be correct.
````
final Function nominal = integer -> {
int diff = definition instanceof DayOfWeekFieldDefinition ? DayOfWeek.MONDAY.getValue() - ((DayOfWeekFieldDefinition) definition).getMondayDoWValue().getMondayDoWValue() : 0;
return DayOfWeek.of(integer + diff < 1 ? 7 : integer + diff).getDisplayName(TextStyle.FULL, bundle.getLocale());
};
````

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.