Incorrect description: "0 0 2/4 * * ?" -> "every hour"
"0 0 2/4 * * ?" is parsed like "every hour".
@AlexBes1 Thank you for reporting this. Will fix this as soon as possible.
Something strange happen when we define for example 0 0 12 13 1/2 ? * and the description should be Day 13 of every 2 month(s) and the description is 'at 12:00 at 13 day every February months'.
I take a look and I think that the problem is in the every describe function: The nominal value should not be calculated because is an every instance.
like every x months / days / years
/**
* Provide a human readable description for Every instance
* @param every - Every
* @return human readable description - String
*/
protected String describe(Every every, boolean and) {
String description;
if (every.getPeriod().getValue() > 1) {
description = String.format("%s %s ", bundle.getString("every"), nominalValue(every.getPeriod())) + " %p ";
} else {
description = bundle.getString("every")+" %s ";
}
if(every.getExpression() instanceof Between){
Between between = (Between) every.getExpression();
description += MessageFormat.format(
bundle.getString("between_x_and_y"),
nominalValue(between.getFrom()),
nominalValue(between.getTo())
)+" ";
}
return description;
}
@RafaelAbreu05 don't you mind checking this in a separate branch, and if works ok, send a pull request to fix the issue? Thanks!
@AlexBes1 @RafaelAbreu05 Fixed! Many thanks to @bertold for the fix!