It there a more concise way to choose a value based on another value than a switch statement?
Any shorter (or more efficient) way to write this . just to be precise, daily, weekly... are being fetched from the interface (input[select])
switch(repeatFrequency) {
case "daily":
diffDays = 1;
break;
case "weekly":
diffDays = 7;
break;
case "weekly_2":
diffDays = 14;
break;
case "monthly":
diffDays=31;//we assume the worst case
break;
case "monthly_3":
diffDays = 92;//we assume the worst case
break;
}