Skip to content

Commit

Permalink
Merge branch 'reward-calculator' into release-v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Feb 7, 2025
2 parents daf5524 + a173dd7 commit 05db270
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utils/Operator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Operator = (network, data) => {
}

function isInterval(){
return runTime.length === 1 && runTime[0].startsWith('every')
return runTime.length === 1 && runTime[0].toLowerCase().startsWith('every')
}

function runTimes(start) {
Expand Down Expand Up @@ -64,7 +64,7 @@ const Operator = (network, data) => {
function runsPerDay(max) {
let runs
if(isInterval()){
const interval = parse(runTime[0].replace('every ', ''))
const interval = parse(runTime[0].toLowerCase().replace('every ', ''))
runs = parse('1d') / interval
}else{
runs = runTimes().length
Expand All @@ -75,20 +75,20 @@ const Operator = (network, data) => {
function runTimesString(){
if (!isInterval()) {
if(runTime.length > 1){
return `at ${runTime.join(', ')}`
return `at ${runTime.join(', ').toLowerCase()}`
}else{
return `at ${runTime.join(', ')} every day`
return `at ${runTime.join(', ').toLowerCase()} every day`
}
}
return runTime.join(', ')
return runTime.join(', ').toLowerCase()
}

function frequency(includeEvery) {
if(runTime.length > 1 && !isInterval()){
return runTime.length + 'x daily'
}else{
if(isInterval()){
return includeEvery ? runTime[0] : runTime[0].replace('every ', '')
return includeEvery ? runTime[0].toLowerCase() : runTime[0].toLowerCase().replace('every ', '')
}
return 'daily'
}
Expand Down

0 comments on commit 05db270

Please sign in to comment.