Parse cron string to schedule and generate previous or next schedule item

Overview

Parse cron string to schedule and generate previous or next schedule item

Parsers

UnixCronParser - implementation unix cron, see https://www.ibm.com/docs/en/db2/11.1?topic=task-unix-cron-format

Usage:

// import library
import 'package:easy_cron/easy_cron.dart';

// create parser instance
final parser = UnixCronParser();

// parse cron time to CronSchedule
final schedule = parser.parse('* * * * *');

// next time
final nextTime = schedule.next();

// previous time
final prevTime = schedule.prev();
You might also like...

Provides API to generate Dart source code

DartWriter DartWriter provides API to generate Dart source code. It can make your job easier while developing flutter/dart tools. You can also generat

Oct 24, 2022

A CLI tool to help generate dart classes from json returned from API

Json 2 Dart Command line utility Important note There is already a package called json2dart so this package will be called json2dartc ! This project w

Oct 5, 2022

Flutter Cool Random User Generate 🔥🔥

Flutter Cool Random User Generate 🔥🔥

Flutter Cool Random User Generate 🔥🔥

Sep 10, 2022

Generate gherkin automated tests

Generate gherkin automated tests

flutter_gherkin_automated Generate gherkin automated tests Preliminary: integration tests performance vs. development Original flutter_gherkin BDD tes

Jul 7, 2022

The Dart Time Machine is a date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.

The Dart Time Machine is a date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.

The Dart Time Machine is a date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.

Oct 8, 2021

Library for help you make userbot or bot telegram and support tdlib telegram database and only support nodejs dart and google-apps-script

To-Do telegram client dart ✅️ support multi token ( bot / userbot ) ✅️ support bot and userbot ✅️ support telegram-bot-api local server ✅️ support tel

Jan 7, 2023

Get Version - Get the Version Name, Version Code, Platform and OS Version, and App ID on iOS and Android. Maintainer: @rodydavis

Get Version - Get the Version Name, Version Code, Platform and OS Version, and App ID on iOS and Android. Maintainer: @rodydavis

Get Version - Get the Version Name, Version Code, Platform and OS Version, and App ID on iOS and Android.

Jan 4, 2023

Converts SVG icons to OTF font and generates Flutter-compatible class. Provides an API and a CLI tool.

Fontify The Fontify package provides an easy way to convert SVG icons to OpenType font and generate Flutter-compatible class that contains identifiers

Oct 28, 2022

An android application built using Flutter that computes the Body Mass Index of person and suggestion to carry ,by taking Inputs (Weight, Height, and Age), Built using Flutter

An android application built using Flutter that computes the Body Mass Index of person and suggestion to carry ,by taking Inputs (Weight, Height, and Age), Built using Flutter

BMI Calculator 💪 Our Goal The objective of this tutorial is to look at how we can customise Flutter Widgets to achieve our own beautiful user interfa

Nov 2, 2022
Comments
  • Unable to parse SAT-SUN range

    Unable to parse SAT-SUN range

    Hi, thanks for the simple library! Unfortunately, when trying to parse a cron expression with a SAT-SUN range, it throws an assertion error. For example: UnixCronParser().parse("0 22 * * SAT-SUN") throws Failed assertion: line 160 pos 12: 'lower < higher && lower >= min && higher <= max': is not true.

    Here's a few unit tests which all currently fail

     expect(
          next('0 22 * * SAT-SUN', startAt: "2022-11-24 16:00"),
          equals('2022-11-26 22:00'),
        );
        expect(
          next('0 22 * * 6-7', startAt: "2022-11-26 23:00"),
          equals('2022-11-27 22:00'),
        );
        expect(
          schedule('0 22 * * SAT-SUN').daysOfWeek,
          equals({DateTime.saturday, DateTime.sunday}),
        );
        expect(
          next('0 22 * * SAT-MON', startAt: "2022-11-27 23:00"),
          equals('2022-11-28 22:00'),
        );
    

    I'll work around this for now by using SAT,SUN instead of SAT-SUN.

    Cheers!

    opened by rockgecko-development 1
Releases(0.9.2)
Owner
Pokhodyun Alexander
Pokhodyun Alexander
A dart package to help you parse and evaluate infix mathematical expressions into their prefix and postfix notations.

A dart package to help you parse and evaluate infix mathematical expressions into their prefix and postfix notations.

Miguel Manjarres 2 Jan 28, 2022
Parse and compose Magnet URI extension (BEP53) ranges.

bep53-range Parse and compose Magnet URI extension (BEP53) ranges. Dart port of https://github.com/webtorrent/bep53-range Usage parse Parse Magnet URI

Chiziaruhoma Ogbonda 2 Feb 7, 2022
A Dart library to parse Portable Executable (PE) format

pefile A Dart library to parse Portable Executable (PE) format Usage A simple usage example: var pe = pefile.parse('C:\\Windows\\System32\\notepad.exe

null 4 Sep 12, 2022
Flutter package to parse iCalendar (.ics) files.

icalendar_parser Package to parse iCalendar (.ics) files written in pure Dart. Implementation of AnyFetch's ics-parser in JavaScript. Getting Started

Guillaume Roux 27 Jan 3, 2023
A simple Flutter / Dart Utility class for converting complex objects to uri and query string

A simple Flutter / Dart Utility class for converting complex or nested objects to uri and query strings you can follow the the article on how this cla

Opata Joshua 5 Sep 7, 2022
Simple CLI tool to produce icons for your next app.

icon_set_generator Simple CLI tool to enable easy production of icon sets for your next application. Installation Clone the repo and add bin/icon_set_

Diego Domínguez Melo 1 Nov 17, 2021
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. Inspired by SwiftGen. Motivation Using asset path str

FlutterGen 1.1k Jan 6, 2023
generate massive amounts of fake data in dart and flutter

generate massive amounts of fake data in Dart & Flutter Faker.dart is a dart port of the famous faker.js package for the web and NodeJS ?? Usage faker

Cas van Luijtelaar 26 Nov 28, 2022
Automatically generate usecase classes from your repository class definition in Dart and Flutter

Repo Case Automatically generate usecase classes from your repository class definition in Dart and Flutter. Check out the official guide on repo_case

Sandro Maglione 5 Jul 30, 2022
A simple command-line application to generate simple folder and file structure for Flutter Applications

Kanza_cli is a simple command line tool to generate folder and file structure for your Flutter apps. To use it, you should do the followings: 1. First

Kanan Yusubov 9 Dec 16, 2022