mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
feat: dayjs
This commit is contained in:
parent
5d801edb76
commit
b4fc1b4c98
@ -29,6 +29,7 @@
|
|||||||
"byte-size": "^8.1.1",
|
"byte-size": "^8.1.1",
|
||||||
"commitlint": "^17.7.1",
|
"commitlint": "^17.7.1",
|
||||||
"daisyui": "^3.6.4",
|
"daisyui": "^3.6.4",
|
||||||
|
"dayjs": "^1.11.9",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"is-ip": "^5.0.1",
|
"is-ip": "^5.0.1",
|
||||||
"ky": "^0.33.3",
|
"ky": "^0.33.3",
|
||||||
|
2296
pnpm-lock.yaml
2296
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,7 @@ import Collapse from '~/components/Collpase'
|
|||||||
import ProxyNodeCard from '~/components/ProxyNodeCard'
|
import ProxyNodeCard from '~/components/ProxyNodeCard'
|
||||||
import { useProxies } from '~/signals/proxies'
|
import { useProxies } from '~/signals/proxies'
|
||||||
import type { Proxy } from '~/types'
|
import type { Proxy } from '~/types'
|
||||||
|
import { formatTimeFromNow } from '~/utils/date'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const {
|
const {
|
||||||
@ -106,8 +107,8 @@ export default () => {
|
|||||||
<span>{proxyProvider.name}</span>
|
<span>{proxyProvider.name}</span>
|
||||||
|
|
||||||
<div class="text-sm text-slate-500">
|
<div class="text-sm text-slate-500">
|
||||||
{proxyProvider.vehicleType} :: Updated at{' '}
|
{proxyProvider.vehicleType} :: Updated{' '}
|
||||||
{new Date(proxyProvider.updatedAt).toLocaleString()}
|
{formatTimeFromNow(proxyProvider.updatedAt)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
8
src/utils/date.ts
Normal file
8
src/utils/date.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import dayjs from 'dayjs'
|
||||||
|
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||||
|
|
||||||
|
dayjs.extend(relativeTime)
|
||||||
|
|
||||||
|
export function formatTimeFromNow(time: number | string) {
|
||||||
|
return dayjs(time).fromNow()
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user