如何将 vuetify 日历间隔格式更改为 24 小时?

siv*_*ouz 4 javascript calendar vue.js vuetify.js

我正在使用类型为 week 的 vuetify 日历,它以 12 小时格式显示时间,包括 AM 和 PM。我如何将其更改为 24 小时格式?

我查看了文档并没有找到太多内容,除了您可以传递期望函数的间隔格式道具。在 vuetify github 上也找到了一个函数。

    <v-calendar
                :now="today"
                :value="today"
                color="primary"
                locale="et"
                type="week"
                :interval-format="intervalFormat"
            >
            </v-calendar>

methods: {
        intervalFormat() {
            const longOptions = { timeZone: 'UTC', hour12: true, hour: '2-digit', minute: '2-digit' }
            const shortOptions = { timeZone: 'UTC', hour12: true, hour: 'numeric', minute: '2-digit' }
            const shortHourOptions = { timeZone: 'UTC', hour12: true, hour: 'numeric' }

            return longOptions
        }
    }
Run Code Online (Sandbox Code Playgroud)

我想要 24 小时格式,但它仍然是 12 小时格式

siv*_*ouz 5

知道了。

intervalFormat(interval) {
        return interval.time
    }
Run Code Online (Sandbox Code Playgroud)