1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-05-14 03:45:07 +00:00

Compare commits

..

No commits in common. "fe9d00f098bd8520978d2412032d24eb8523fcbc" and "41dc2c525153dc368c23b35c7973f497a72d48dc" have entirely different histories.

2 changed files with 4 additions and 48 deletions

View File

@ -22,11 +22,7 @@
{{ timeString }}<span {{ timeString }}<span
class="seconds-text" class="seconds-text"
:style="secondsStyle" :style="secondsStyle"
>{{ secondsString }}</span><span >{{ secondsString }}</span>
v-if="use12hClock"
class="ampm-text"
:style="secondsStyle"
> {{ amPmString }}</span>
</div> </div>
<div <div
class="date-line mt-3" class="date-line mt-3"
@ -306,10 +302,7 @@
<v-tabs-window-item value="clock"> <v-tabs-window-item value="clock">
<div class="d-flex flex-column align-center justify-center"> <div class="d-flex flex-column align-center justify-center">
<div class="fullscreen-time-display"> <div class="fullscreen-time-display">
{{ timeString }}<span class="fullscreen-seconds">{{ secondsString }}</span><span {{ timeString }}<span class="fullscreen-seconds">{{ secondsString }}</span>
v-if="use12hClock"
class="fullscreen-seconds"
> {{ amPmString }}</span>
</div> </div>
<div class="fullscreen-date-line mt-6"> <div class="fullscreen-date-line mt-6">
{{ dateString }} {{ weekdayString }} {{ periodOfDay }} {{ dateString }} {{ weekdayString }} {{ periodOfDay }}
@ -684,24 +677,6 @@
/> />
</template> </template>
</v-list-item> </v-list-item>
<v-list-item>
<template #prepend>
<v-icon
class="mr-3"
icon="mdi-clock-time-six-outline"
/>
</template>
<v-list-item-title>12 小时制</v-list-item-title>
<v-list-item-subtitle> 12 小时制AM/PM显示时间</v-list-item-subtitle>
<template #append>
<v-switch
:model-value="use12hClock"
hide-details
density="comfortable"
@update:model-value="setUse12hClock"
/>
</template>
</v-list-item>
</v-list> </v-list>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
@ -745,7 +720,6 @@ export default {
showFullscreen: false, showFullscreen: false,
showSettings: false, showSettings: false,
timeCardEnabled: true, timeCardEnabled: true,
use12hClock: false,
// //
fullscreenMode: 'clock', fullscreenMode: 'clock',
// //
@ -811,16 +785,9 @@ export default {
}, },
computed: { computed: {
timeString() { timeString() {
const hours = this.now.getHours() const h = String(this.now.getHours()).padStart(2, '0')
const m = String(this.now.getMinutes()).padStart(2, '0') const m = String(this.now.getMinutes()).padStart(2, '0')
if (this.use12hClock) { return `${h}:${m}`
const h12 = hours % 12 || 12
return `${h12}:${m}`
}
return `${String(hours).padStart(2, '0')}:${m}`
},
amPmString() {
return this.now.getHours() < 12 ? 'AM' : 'PM'
}, },
secondsString() { secondsString() {
return `:${String(this.now.getSeconds()).padStart(2, '0')}` return `:${String(this.now.getSeconds()).padStart(2, '0')}`
@ -1027,17 +994,12 @@ export default {
loadSettings() { loadSettings() {
this.fontSize = SettingsManager.getSetting('font.size') this.fontSize = SettingsManager.getSetting('font.size')
this.timeCardEnabled = getSetting('timeCard.enabled') this.timeCardEnabled = getSetting('timeCard.enabled')
this.use12hClock = getSetting('timeCard.use12h')
this.noiseEnabled = getSetting('noiseMonitor.enabled') this.noiseEnabled = getSetting('noiseMonitor.enabled')
}, },
setTimeCardEnabled(val) { setTimeCardEnabled(val) {
this.timeCardEnabled = val this.timeCardEnabled = val
setSetting('timeCard.enabled', val) setSetting('timeCard.enabled', val)
}, },
setUse12hClock(val) {
this.use12hClock = val
setSetting('timeCard.use12h', val)
},
startTimer() { startTimer() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.now = new Date() this.now = new Date()

View File

@ -127,12 +127,6 @@ const settingsDefinitions = {
description: "启用时间卡片", description: "启用时间卡片",
icon: "mdi-clock-outline", icon: "mdi-clock-outline",
}, },
"timeCard.use12h": {
type: "boolean",
default: false,
description: "使用 12 小时制显示时间",
icon: "mdi-clock-time-six-outline",
},
// 一言设置 // 一言设置
"hitokoto.enabled": { "hitokoto.enabled": {