hron 2.2.1
hron: ^2.2.1 copied to clipboard
Human-readable cron — scheduling expressions that read like English and convert to and from cron.
Changelog #
Current version: 2.2.1
2.2.1 #
- No changes to the Dart package. hron's packages share one version, and 2.2.1 fixes the WebAssembly package.
2.2.0 #
- No changes to the Dart package. hron's packages share one version, and 2.2.0 changes the TypeScript package.
2.1.0 #
- No changes to the Dart package. hron's packages share one version, and 2.1.0 adds the Kotlin package.
2.0.0 #
- Breaking:
package:hron/hron.dartno longer exportsScheduleDataor the helpersexpandDaySpec,expandMonthTargetandordinalSuffix, andWeekday.tryParse,Weekday.fromNumberandMonthName.tryParseare removed. No public method accepted them; build a schedule withSchedule.parseorSchedule.fromCron. - Breaking: the lists in a schedule's parts are unmodifiable, so changing one throws
UnsupportedError, and a schedule cannot change after it is built. - Breaking:
Scheduleis afinal class, so another library can no longer implement or extend it, for example as a mock. EveryScheduleis then one thatparseorfromCronbuilt, which==relies on. Schedulehas the gettersexcept,until,startingandduringbesidetimezoneandexpression.Scheduleand every part type have==andhashCode: schedules are equal when their parts are, soevery day at 9:00equalsevery day at 09:00.OrdinalPosition.toNreturns -1 forlastinstead of throwing.- Breaking: the package requires
timezone^0.11.1. - Breaking: every invalid schedule is rejected by
Schedule.parse, andSchedule.validatereturns false for it: a nameduntilsuch asuntil dec 31withoutstarting, a time window that crosses midnight, an unknown timezone name or an abbreviation such asEST, year0000, and a number above 2147483647. Timezone names match in any case and display in their IANA form. - Breaking: every lex, parse and cron error message has new text, the same in every hron implementation, and error spans count Unicode code points rather than UTF-16 code units.
- Breaking:
fromCronandtoCronconvert exactly or fail;toCronnow converts many more schedules, andfromCronfails on a cron that restricts both day fields or on irregular times such as*/7 * * * *. now,from,toanddatetimecount only as instants, and every result is aTZDateTimein the schedule's zone, or UTC without one.startingis a lower bound as well as the interval anchor.- Evaluation is the same as in every other hron implementation: a fall-back takes the first pass, a time in a spring-forward gap moves by the length of the gap, and results outside the supported range are null. Evaluation also works when compiled to JavaScript, where
nextFromused to throw.
See GitHub Releases for release notes.