-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: more specific times recurrence #7
feat: more specific times recurrence #7
Conversation
Thanks for contributing again, You may follow up the same convention of I do suggest to change to be like
I would like to hear your thoughts on that |
Thank you for the feedback. Your suggestion is how I wanted to implement it because I noticed For example, a user may want to do only I will make a PR following your suggested convention and I plan to implement it by function everyDay() {
let expression = "min hour * * *";
return {
toString() { // or toExpression
return "0 0 * * *";
},
atHour(_hour) {
expression = expression.replace("hour", _hour);
return {
toString() { // or toExpression
return expression.replace("min", "0");
},
atMinute(_minute) {
return expression.replace("min", _minute);
},
};
},
};
}
console.log(everyDay().toString()); // 0 0 * * *
console.log(everyDay().atHour(2).toString()); // 0 2 * * *
console.log(everyDay().atHour(2).atMinute(30)); // 30 2 * * * We can also make it strict by making sure that all functions are complete executed, What are your thoughts? |
@omarkhairy21 just mentioning you once again in case you missed my latest comment |
Thanks for mentioning and reminder i apologize i was very busy last week i pretty much agree with you except use
|
Thank you for the feedback @omarkhairy21 |
Thanks, Orim Great work! I did add a small fix for months starting from 0 to 12 (13 months lol!..my mistake) but that standard was 1-12. I will create a new issue to improve the readability of the test description. if you can work on that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Geat @orimdominic thanks.
Add two methods for specific recurrence
everyDayAtHourAndMinute(hour, minute)
everyMonthAt(day, hour, minute)