Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ voteConfirm: "Are you sure that you want to vote?"
deleteAccount: "Delete Account"
deleteAccountConfirm: "Are you sure that you want to delete this account?"
createdAt: "Created at"
enableAbsoluteTime: "Enable Absolute Time"

_template:
edit: "Edit Template..."
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ voteConfirm: "投票しますか?"
deleteAccount: "アカウント削除"
deleteAccountConfirm: "本当にこのアカウントを削除しますか?"
createdAt: "作成日時"
enableAbsoluteTime: "絶対時刻表記を使用する"

_template:
edit: "定型文を編集…"
Expand Down
8 changes: 6 additions & 2 deletions src/client/components/note-detailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<div class="info">
<button class="_button time" @click="showRenoteMenu()" ref="renoteTime">
<Fa class="dropdownIcon" v-if="isMyRenote || (this.$i.isModerator || this.$i.isAdmin)" :icon="faEllipsisH"/>
<MkTime :time="note.createdAt"/>
<MkTime v-if="enableAbsoluteTime" :time="note.createdAt" mode="absolute"/>
<MkTime v-else-if="!enableAbsoluteTime" :time="note.createdAt" mode="relative"/>
</button>
<span class="visibility" v-if="note.visibility !== 'public'">
<VisibilityIcon
Expand Down Expand Up @@ -168,7 +169,7 @@ import copyToClipboard from '@/scripts/copy-to-clipboard';
import { checkWordMute } from '@/scripts/check-word-mute';
import { userPage } from '@/filters/user';
import * as os from '@/os';
import { noteActions, noteViewInterruptors } from '@/store';
import { defaultStore, noteActions, noteViewInterruptors } from '@/store';
import { extractUrlFromMfm } from '../../misc/extract-url-from-mfm';

function markRawAll(...xs) {
Expand Down Expand Up @@ -230,6 +231,9 @@ export default defineComponent({
},

computed: {
enableAbsoluteTime() {
return this.$store.reactiveState.enableAbsoluteTime.value;
},
disableReactions() {
return this.$store.reactiveState.disableReactions.value;
},
Expand Down
10 changes: 9 additions & 1 deletion src/client/components/note-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
<div class="info">
<span class="mobile" v-if="note.viaMobile"><Fa :icon="faMobileAlt"/></span>
<MkA class="created-at" :to="notePage(note)">
<MkTime :time="note.createdAt"/>
<MkTime v-if="enableAbsoluteTime" :time="note.createdAt" mode="absolute"/>
<MkTime v-else-if="!enableAbsoluteTime" :time="note.createdAt" mode="relative"/>
</MkA>
<VisibilityIcon class="visibility" v-if="note.visibility !== 'public' || note.localOnly || note.remoteFollowersOnly"
:visibility="note.visibility"
Expand All @@ -36,6 +37,7 @@ import notePage from '../filters/note';
import { userPage } from '../filters/user';
import GpVerified from './verified.vue';
import VisibilityIcon from './visibility-icon.vue';
import { defaultStore } from '@/store';

export default defineComponent({
components: {
Expand All @@ -62,6 +64,12 @@ export default defineComponent({
methods: {
notePage,
userPage
},

computed: {
enableAbsoluteTime() {
return this.$store.reactiveState.enableAbsoluteTime.value;
},
}
});
</script>
Expand Down
8 changes: 6 additions & 2 deletions src/client/components/note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<div class="info">
<button class="_button time" @click="showRenoteMenu()" ref="renoteTime">
<Fa class="dropdownIcon" v-if="isMyRenote || (this.$i.isModerator || this.$i.isAdmin)" :icon="faEllipsisV"/>
<MkTime :time="note.createdAt"/>
<MkTime v-if="enableAbsoluteTime" :time="note.createdAt" mode="absolute"/>
<MkTime v-else-if="!enableAbsoluteTime" :time="note.createdAt" mode="relative"/>
</button>
<VisibilityIcon class="visibility" v-if="note.visibility !== 'public' || note.localOnly || note.remoteFollowersOnly"
:visibility="note.visibility"
Expand Down Expand Up @@ -145,7 +146,7 @@ import copyToClipboard from '@/scripts/copy-to-clipboard';
import { checkWordMute } from '@/scripts/check-word-mute';
import { userPage } from '@/filters/user';
import * as os from '@/os';
import { noteActions, noteViewInterruptors } from '@/store';
import { defaultStore, noteActions, noteViewInterruptors } from '@/store';
import { extractUrlFromMfm } from '@/../misc/extract-url-from-mfm';
import VisibilityIcon from './visibility-icon.vue';

Expand Down Expand Up @@ -220,6 +221,9 @@ export default defineComponent({
},

computed: {
enableAbsoluteTime() {
return this.$store.reactiveState.enableAbsoluteTime.value;
},
disableReactions() {
return this.$store.reactiveState.disableReactions.value;
},
Expand Down
7 changes: 6 additions & 1 deletion src/client/components/notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<header>
<MkA v-if="notification.user" class="name" :to="userPage(notification.user)" v-user-preview="notification.user.id"><MkUserName :user="notification.user"/></MkA>
<span v-else style="font-weight: bold">{{ notification.header }}</span>
<MkTime :time="notification.createdAt" v-if="withTime" class="time"/>
<MkTime :time="notification.createdAt" mode="absolute" v-if="withTime && enableAbsoluteTime" class="time"/>
<MkTime :time="notification.createdAt" mode="relative" v-else-if="withTime && !enableAbsoluteTime" class="time"/>
</header>
<MkA v-if="notification.type === 'reaction'" class="text" :to="notePage(notification.note)" :title="getNoteSummary(notification.note)">
<Fa :icon="faQuoteLeft"/>
Expand Down Expand Up @@ -89,6 +90,7 @@ import notePage from '../filters/note';
import { userPage } from '../filters/user';
import { i18n } from '@/i18n';
import * as os from '@/os';
import { defaultStore } from '@/store';

const locale = i18n.locale;

Expand Down Expand Up @@ -128,6 +130,9 @@ export default defineComponent({
isCompactMode(): boolean {
return this.$store.state.postStyle === 'compact';
},
enableAbsoluteTime() {
return this.$store.reactiveState.enableAbsoluteTime.value;
},
},

mounted() {
Expand Down
2 changes: 2 additions & 0 deletions src/client/pages/settings/general.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<FormSwitch v-model:value="useSticker">{{ $ts.useSticker }}
<template #desc>{{$ts.useStickerDesc}}</template>
</FormSwitch>
<FormSwitch v-model:value="enableAbsoluteTime">{{ $ts.enableAbsoluteTime }}</FormSwitch>
</FormGroup>

<FormSwitch v-model:value="showFullAcct">{{ $ts.showFullAcct }}
Expand Down Expand Up @@ -228,6 +229,7 @@ export default defineComponent({
showVoteConfirm: defaultStore.makeGetterSetter('showVoteConfirm'),
aiChanMode: defaultStore.makeGetterSetter('aiChanMode'),
renoteButtonMode: defaultStore.makeGetterSetter('renoteButtonMode'),
enableAbsoluteTime: defaultStore.makeGetterSetter('enableAbsoluteTime'),
},

watch: {
Expand Down
5 changes: 5 additions & 0 deletions src/client/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,11 @@ export const defaultStore = markRaw(new Storage('base', {
default: false
},

enableAbsoluteTime: {
where: 'device',
default: false
},

//#endregion
}));

Expand Down