Skip to content

Incorrect descriptor result #380

@kostya05983

Description

@kostya05983

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<Integer, String> 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());
        };

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions