https://github.com/jamalianpour/cron_expression_descriptor
Dart library for describe cron expressions, convert cron expressions to human readable
https://github.com/jamalianpour/cron_expression_descriptor
cron dart flutter
Last synced: about 2 months ago
JSON representation
Dart library for describe cron expressions, convert cron expressions to human readable
- Host: GitHub
- URL: https://github.com/jamalianpour/cron_expression_descriptor
- Owner: Jamalianpour
- License: bsd-3-clause
- Created: 2024-03-27T13:33:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-28T09:29:17.000Z (about 1 year ago)
- Last Synced: 2024-03-28T15:35:07.603Z (about 1 year ago)
- Topics: cron, dart, flutter
- Language: Dart
- Homepage: https://pub.dev/packages/cron_expression_descriptor
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Cron Expression Descriptor
This is a simple Dart library for describe cron expressions. currently it's support simple 5 segment cron expression.┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6)
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
* * * * * cron expression## Getting started
Add dependencies into you project pubspec.yaml file:
```yaml
dependencies:
cron_expression_descriptor: ^0.9.0
```## Usage
A simple usage example:
```dart
import 'package:cron_expression_descriptor/cron_expression_descriptor.dart';
main() {
final CronExpressionDescriptor cronExpressionDescriptor = CronExpressionDescriptor();print(
cronExpressionDescriptor.convertCronToHumanReadable(cronExpression: '15 14 1 * *'),
);
// output: At 14:15, on day 1 of the month
}
```## Output examples
Some other examples of Descriptor is like:```
* * * * * -> "Every minute"* * */10 */9 */4 -> "Every minute, every 10 days, every 4 days of the week, every 9 months"
0 22 * * 1-5 -> "At 22:00, Monday through Friday"
15 1,12 1 */2 * -> "At minute 15 of 1 and 12, on day 1 of the month, every 2 months"
```