Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getCronString(interval, value) {
- switch (interval) {
- case 'monthly': {
- return `***/${value}**`;
- }
- case 'weekly': {
- const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
- return days.forEach(function(day, index) {
- if (day === value) {
- console.log('day-->>', index);
- return `*****/${days}`;
- }
- });
- }
- case 'daily': {
- return `**/${value}***`;
- }
- }
- }
Add Comment
Please, Sign In to add comment