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

View File

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