Guest User

Untitled

a guest
Jun 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function getCronString(interval, value) {
  2. switch (interval) {
  3. case 'monthly': {
  4. return `***/${value}**`;
  5. }
  6. case 'weekly': {
  7. const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
  8. return days.forEach(function(day, index) {
  9. if (day === value) {
  10. console.log('day-->>', index);
  11. return `*****/${days}`;
  12. }
  13. });
  14. }
  15. case 'daily': {
  16. return `**/${value}***`;
  17. }
  18. }
  19. }
Add Comment
Please, Sign In to add comment