mirror of
https://git.crystalyx.net/Xefir/repod.git
synced 2024-12-26 16:55:13 +01:00
feat: migrate from moment to date-fns
This commit is contained in:
parent
3e8cf91c32
commit
f0e6392f06
33
package-lock.json
generated
33
package-lock.json
generated
@ -13,9 +13,9 @@
|
||||
"@nextcloud/dialogs": "^5.0.3",
|
||||
"@nextcloud/initial-state": "^2.1.0",
|
||||
"@nextcloud/l10n": "^2.2.0",
|
||||
"@nextcloud/moment": "^1.3.0",
|
||||
"@nextcloud/router": "^2.2.0",
|
||||
"@nextcloud/vue": "^8.4.0",
|
||||
"date-fns": "^3.2.0",
|
||||
"vue": "^2",
|
||||
"vue-material-design-icons": "^5.2.0",
|
||||
"vue-router": "^3",
|
||||
@ -3217,20 +3217,6 @@
|
||||
"npm": "^9.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/moment": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/moment/-/moment-1.3.0.tgz",
|
||||
"integrity": "sha512-UnCjVeif8KmDhuqpl1KwNaVXtPsXZjm/B+LmJoXiJCapKVhAt1+DK106VqGFNYutxfKdD/5ny+JOvBIVEce9CA==",
|
||||
"dependencies": {
|
||||
"@nextcloud/l10n": "^2.2.0",
|
||||
"moment": "^2.30.1",
|
||||
"node-gettext": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.0.0",
|
||||
"npm": "^9.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nextcloud/paths": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.1.0.tgz",
|
||||
@ -6752,6 +6738,15 @@
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/date-fns": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.2.0.tgz",
|
||||
"integrity": "sha512-E4KWKavANzeuusPi0jUjpuI22SURAznGkx7eZV+4i6x2A+IZxAMcajgkvuDAU1bg40+xuhW1zRdVIIM/4khuIg==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/kossnocorp"
|
||||
}
|
||||
},
|
||||
"node_modules/date-format-parse": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/date-format-parse/-/date-format-parse-0.2.7.tgz",
|
||||
@ -13157,14 +13152,6 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.30.1",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
|
||||
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
|
@ -22,9 +22,9 @@
|
||||
"@nextcloud/dialogs": "^5.0.3",
|
||||
"@nextcloud/initial-state": "^2.1.0",
|
||||
"@nextcloud/l10n": "^2.2.0",
|
||||
"@nextcloud/moment": "^1.3.0",
|
||||
"@nextcloud/router": "^2.2.0",
|
||||
"@nextcloud/vue": "^8.4.0",
|
||||
"date-fns": "^3.2.0",
|
||||
"vue": "^2",
|
||||
"vue-material-design-icons": "^5.2.0",
|
||||
"vue-router": "^3",
|
||||
|
@ -4,7 +4,7 @@
|
||||
<AdaptativeList v-if="!loading">
|
||||
<NcListItem v-for="feed in feeds"
|
||||
:key="feed.link"
|
||||
:details="moment(feed.fetchedAtUnix*1000).fromNow()"
|
||||
:details="formatDistanceToNow(new Date(feed.fetchedAtUnix*1000))"
|
||||
:name="feed.title"
|
||||
:to="toUrl(feed.link)">
|
||||
<template #icon>
|
||||
@ -26,8 +26,8 @@ import AdaptativeList from '../Atoms/AdaptativeList.vue'
|
||||
import Loading from '../Atoms/Loading.vue'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { debounce } from '../../utils/debounce.js'
|
||||
import { formatDistanceToNow } from 'date-fns'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import moment from '@nextcloud/moment'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
|
||||
export default {
|
||||
@ -56,7 +56,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
moment,
|
||||
formatDistanceToNow,
|
||||
search: debounce(async function value() {
|
||||
try {
|
||||
this.loading = true
|
||||
|
@ -6,7 +6,7 @@
|
||||
:key="episode.episodeGuid"
|
||||
:active="isCurrentEpisode(episode)"
|
||||
:class="episode.episodeAction && episode.episodeAction.position >= episode.episodeAction.total ? 'ended': ''"
|
||||
:details="moment(episode.episodePubDate.date).fromNow()"
|
||||
:details="formatDistanceToNow(new Date(episode.episodePubDate.date))"
|
||||
:force-display-actions="true"
|
||||
:name="episode.episodeName"
|
||||
:title="episode.episodeDescription"
|
||||
@ -56,9 +56,9 @@ import Modal from './Modal.vue'
|
||||
import PlayButton from 'vue-material-design-icons/Play.vue'
|
||||
import StopButton from 'vue-material-design-icons/Stop.vue'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { formatDistanceToNow } from 'date-fns'
|
||||
import { formatTimer } from '../../utils/time.js'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import moment from '@nextcloud/moment'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
|
||||
export default {
|
||||
@ -103,7 +103,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
formatTimer,
|
||||
moment,
|
||||
formatDistanceToNow,
|
||||
isCurrentEpisode(episode) {
|
||||
return this.currentEpisode && this.currentEpisode.episodeUrl === episode.episodeUrl
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
import axios from '@nextcloud/axios'
|
||||
import { format } from 'date-fns'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import moment from '@nextcloud/moment'
|
||||
import router from '../router.js'
|
||||
import store from './main.js'
|
||||
|
||||
@ -94,7 +94,7 @@ export const player = {
|
||||
episode: context.state.episode.episodeUrl,
|
||||
guid: context.state.episode.episodeGuid,
|
||||
action: 'play',
|
||||
timestamp: moment().format('YYYY-MM-DD[T]HH:mm:ss'),
|
||||
timestamp: format(new Date(), 'yyyy-MM-dd[T]HH:mm:ss'),
|
||||
started: Math.round(context.state.action ? context.state.action.started : 0),
|
||||
position: Math.round(audio.currentTime),
|
||||
total: Math.round(audio.duration),
|
||||
|
Loading…
Reference in New Issue
Block a user