Skip to content
Merged
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
2 changes: 0 additions & 2 deletions core/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@types/numeral": "^2.0.5",
"@types/semver": "^7.3.9",
"@types/semver-stable": "^3.0.0",
"@types/timeago": "^1.6.0",
"@types/uuid": "^9.0.0",
"ansi_up": "^5.2.1",
"apexcharts": "^3.36.3",
Expand All @@ -51,7 +50,6 @@
"http-status-codes": "^2.2.0",
"image-js": "^0.35.3",
"is-ip": "^5.0.0",
"javascript-time-ago": "^2.3.11",
"jsoneditor": "^9.10.0",
"lodash": "^4.17.21",
"marked": "^4.1.1",
Expand Down
8 changes: 2 additions & 6 deletions core/frontend/src/components/ethernet/InterfaceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@
</template>

<script lang="ts">
import TimeAgo from 'javascript-time-ago'
import en from 'javascript-time-ago/locale/en.json'
import { formatDistanceToNow } from 'date-fns'
import Vue, { PropType } from 'vue'

import beacon from '@/store/beacon'
Expand All @@ -191,9 +190,6 @@ import AddressCreationDialog from './AddressCreationDialog.vue'
import AddressDeletionDialog from './AddressDeletionDialog.vue'
import DHCPServerDialog from './DHCPServerDialog.vue'

TimeAgo.addDefaultLocale(en)
const timeAgo = new TimeAgo('en-US')

export default Vue.extend({
name: 'InterfaceCard',
components: {
Expand Down Expand Up @@ -375,7 +371,7 @@ export default Vue.extend({
return 'Expired'
}

return timeAgo.format(expiresAt, 'round')
return formatDistanceToNow(expiresAt, { addSuffix: true })
},
getLeaseExpiryClass(lease: DHCPServerLease): string {
const now = new Date()
Expand Down
8 changes: 2 additions & 6 deletions core/frontend/src/components/version-chooser/VersionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@
</template>

<script lang="ts">
import TimeAgo from 'javascript-time-ago'
import en from 'javascript-time-ago/locale/en.json'
import { formatDistanceToNow } from 'date-fns'
import Vue, { PropType } from 'vue'

import WarningDialog from '@/components/common/WarningDialog.vue'
Expand All @@ -145,9 +144,6 @@ import { DEFAULT_REMOTE_IMAGE, getFactoryVersion } from '@/utils/version_chooser

import SpinningLogo from '../common/SpinningLogo.vue'

TimeAgo.addDefaultLocale(en)
const timeAgo = new TimeAgo('en-US')

export default Vue.extend({
name: 'VersionCard',
components: {
Expand Down Expand Up @@ -253,7 +249,7 @@ export default Vue.extend({
},
methods: {
asTimeAgo(value: string) {
return timeAgo.format(new Date(Date.parse(value)), 'round')
return formatDistanceToNow(new Date(Date.parse(value)), { addSuffix: true })
},
shortSha(value: string) {
if (value === null) {
Expand Down
Loading