1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: fall back to today badge on project page

This commit is contained in:
Ferdinand Mütsch
2022-04-18 11:49:06 +02:00
parent 40067d252e
commit e774039831
2 changed files with 4 additions and 4 deletions

View File

@@ -2,8 +2,8 @@ PetiteVue.createApp({
$delimiters: ['${', '}'],
get currentInterval() {
const urlParams = new URLSearchParams(window.location.search)
return urlParams.has('interval')
? urlParams.get('interval')
: null
if (urlParams.has('interval')) return urlParams.get('interval')
if (!urlParams.has('from') && !urlParams.has('to')) return 'today'
return null
}
}).mount('#summary-page')