| | |
| | | int mins = 60;
|
| | | if (!StringUtils.isEmpty(frequency)) {
|
| | | try {
|
| | | String str;
|
| | | String str = frequency.trim();
|
| | | if (frequency.indexOf(' ') > -1) {
|
| | | str = frequency.substring(0, frequency.indexOf(' ')).trim();
|
| | | } else {
|
| | | str = frequency.trim();
|
| | | str = str.substring(0, str.indexOf(' ')).trim();
|
| | | }
|
| | | mins = (int) Float.parseFloat(str);
|
| | | } catch (NumberFormatException e) {
|
| | |
| | | }
|
| | | if (frequency.indexOf("day") > -1) {
|
| | | // convert to minutes
|
| | | mins *= 24 * 60;
|
| | | mins *= 1440;
|
| | | } else if (frequency.indexOf("hour") > -1) {
|
| | | // convert to minutes
|
| | | mins *= 60;
|