[web] Simplify variable naming

This commit is contained in:
Alain Nussbaumer 2024-04-27 21:34:16 +02:00
parent 2d7776619f
commit 9319118190
2 changed files with 8 additions and 8 deletions

View File

@ -31,8 +31,8 @@ export const filters = {
.setLocale(locale.value)
.toLocaleString(DateTime.DATETIME_MED)
},
durationInDays(value_ms) {
const minutes = Math.floor(value_ms / 60000)
durationInDays(value) {
const minutes = Math.floor(value / 60000)
if (minutes > 1440) {
return Duration.fromObject({ minutes })
.shiftTo('days', 'hours', 'minutes')
@ -44,9 +44,9 @@ export const filters = {
}
return Duration.fromObject({ minutes }).shiftTo('minutes').toHuman()
},
durationInHours(value_ms) {
const format = value_ms >= 3600000 ? 'h:mm:ss' : 'm:ss'
return Duration.fromMillis(value_ms).toFormat(format)
durationInHours(value) {
const format = value >= 3600000 ? 'h:mm:ss' : 'm:ss'
return Duration.fromMillis(value).toFormat(format)
},
number(value) {
return value.toLocaleString(locale.value)

View File

@ -4,7 +4,7 @@
<div class="columns is-centered">
<div class="column is-four-fifths">
<section v-if="$slots.options">
<div ref="options_ref" style="height: 1px" />
<div ref="options" style="height: 1px" />
<slot name="options" />
<nav class="buttons is-centered mt-4 mb-2">
<router-link class="button is-small is-white" :to="position">
@ -65,12 +65,12 @@ export default {
rootMargin: '-82px 0px 0px 0px',
threshold: 1.0
})
this.observer.observe(this.$refs.options_ref)
this.observer.observe(this.$refs.options)
}
},
methods: {
onElementObserved(entries) {
entries.forEach(({ target, isIntersecting }) => {
entries.forEach(({ isIntersecting }) => {
this.options_visible = isIntersecting
})
},