Open unstoppable95 opened 1 year ago
@unstoppable95 could you provide some PR with a test, to reproduce the issue?
just add new static method in CronMapper class:
public static CronMapper fromQuartzToSpring53() { return new CronMapper( CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ), CronDefinitionBuilder.instanceDefinitionFor(CronType.SPRING53), setQuestionMark() ); }
and then try to use in some test e.g:
@Test public void testRangeOfTimeQuartzToSpring53() { final String expected = "0 15 10 ? * 5#3"; final String expression = "0 15 10 ? * 6#3 1984"; assertEquals(expected, CronMapper.fromQuartzToSpring53().map(quartzParser().parse(expression)).asString()); }
and this results in "IllegalArgumentExpression....value missing for a#b cron expression" and main problem is in inside
at com.cronutils.model.field.expression.On.
Regards & sorry for not creating PR, I did not have git installed on this PC and can't to this without local admin role...
@unstoppable95 Do you happen to know if SPRING53 to QUARTZ mapping works correctly?
I mean, if you build a custom CronMapper
in a similar way to com.cronutils.mapper.CronMapper.fromSpringToQuartz()
.
It seems to work (at least for simple cases) but it would be nice to have the CronMapper#fromSpring53ToQuartz()
method too.
Hi guys, I'd like to have a mapper from QUARTZ format to SPRING53 as I need to support additional L, # for days of the week and L,W day of the month. After creating my custom one and calling .map method I keep getting a problem that "value missing for a#b cron expresion" even it it's already there inside Cron when I call mapper.map() method (from is quartz definition and to is spring53 type inside CronMapper constuctor). Is there a chance to support this feature in upcoming weeks/months?