Closed kirrg001 closed 8 years ago
You want
var schedule = later.parse.text('on friday on the last day of the month')
You can verify that you string is correct by doing console.log(schedule)
. The error
property indicates the position in the text string where an error in parsing has occurred. You want this to be -1 for a valid text string. You'll want to look at the syntax trees at https://bunkat.github.io/later/parsers.html#text for information on how to form the strings properly. It only supports a very strict syntax, not general English phrases.
Hey thanks for fast response.
var schedule = later.parse.text('on friday on the last day of the month', true);
console.log(later.schedule(schedule).next(10));
[ Fri Sep 30 2016 02:00:00 GMT+0200 (CEST),
Fri Mar 31 2017 02:00:00 GMT+0200 (CEST),
Fri Jun 30 2017 02:00:00 GMT+0200 (CEST),
Fri Aug 31 2018 02:00:00 GMT+0200 (CEST),
Fri Nov 30 2018 01:00:00 GMT+0100 (CET),
Fri May 31 2019 02:00:00 GMT+0200 (CEST),
Fri Jan 31 2020 01:00:00 GMT+0100 (CET),
Fri Jul 31 2020 02:00:00 GMT+0200 (CEST),
Fri Apr 30 2021 02:00:00 GMT+0200 (CEST),
Fri Dec 31 2021 01:00:00 GMT+0100 (CET) ]
Sorry it's late here. You want day instance, not day of the month.
var schedule = later.parse.text('on friday on the last day instance');
works!
Hey, nice lib. I want get every last
DAY
of the month.prints
Thanks!