croncpp icon indicating copy to clipboard operation
croncpp copied to clipboard

Example does appear to work/parse?

Open harlowja opened this issue 5 years ago • 1 comments

I was trying some of the examples and saw the following happen:

Trying: 0 15 10 L * ?
terminate called after throwing an instance of 'cron::bad_cronexpr'
  what():  stoul
Aborted (core dumped)

Program code (nothing crazy):

#include "croncpp.h"

#include <chrono>
#include <iostream>
#include <string>

int main(int argc, char** argv) {
    std::string c = argv[1];
    std::cout << "Trying: "<< c << "\n";
    auto cexpr = cron::make_cron(c);
    auto now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
    auto next = cron::cron_next(cexpr, now);
    std::cout << next << "\n";
    return 0;
}

I also tried with the various oracle and quartz traits, but didn't seem to work.

Perhaps remove from the README.md if this format doesn't work?

harlowja avatar Nov 11 '20 16:11 harlowja

You are correct, L and W are not currently supported and the readme.md is misleading about this.

mariusbancila avatar Nov 12 '20 14:11 mariusbancila