移除无用的时间函数

This commit is contained in:
2025-02-16 23:40:29 +08:00
parent 52cbe2a7ed
commit bb83a87748
5 changed files with 1 additions and 23 deletions

View File

@@ -2,7 +2,6 @@
import { request, type BaseResponseData } from '@/lib/request';
import { computed, onMounted, reactive, ref, watch, watchEffect } from 'vue';
import { useRoute } from 'vue-router';
import { timestampToString } from '@/lib/timestampToString';
const model = defineModel();
const route = useRoute()
const bloguuid = route.params.uuid;

View File

@@ -2,7 +2,6 @@
import { onMounted, reactive, ref, type Ref } from 'vue';
import { request, type BaseResponseData } from '../../lib/request'
import { ElMessage, ElMessageBox } from 'element-plus';
import { timestampToString } from '@/lib/timestampToString';
const tableData: Ref<any[]> = ref([])
const dialogEditFormVisible = ref(false);
type BlogContentData = {

View File

@@ -1,21 +1,3 @@
function timestampToString(timestamp: string | number) {
if (timestamp === undefined || timestamp === null) {
throw new Error('Timestamp cannot be undefined or null');
}
const date = new Date(+timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // getMonth() returns 0-11, so we add 1
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
}
function timestampToRelativeWeekday(timestamp: string | number) {
if (timestamp === undefined || timestamp === null) {
throw new Error('Timestamp cannot be undefined or null');
@@ -43,4 +25,4 @@ function timestampToRelativeWeekday(timestamp: string | number) {
}
}
export { timestampToString, timestampToRelativeWeekday }
export { timestampToRelativeWeekday }

View File

@@ -1,7 +1,6 @@
<script setup lang='ts'>
import { request, type BaseResponseData } from '@/lib/request';
import { onMounted, reactive, ref } from 'vue';
import { timestampToString } from '../lib/timestampToString'
import { formateTimes } from '@/lib/formateTimes';
const loadStatus = ref(0);
const blogList: any[] = reactive([]);

View File

@@ -1,7 +1,6 @@
<script setup lang='ts'>
import { request, type BaseResponseData } from '@/lib/request';
import { onMounted, onUnmounted, ref, type Ref } from 'vue';
import { timestampToString } from '../lib/timestampToString'
import { useRoute } from 'vue-router'
import { Marked } from 'marked';
import { markedHighlight } from "marked-highlight";