Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Commit

Permalink
swap momentjs with dayjs
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenC56 committed Sep 20, 2020
1 parent d4dc2a1 commit 597d6f3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 50 deletions.
4 changes: 2 additions & 2 deletions frontend/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default {
// Doc: https://github.com/nuxt-community/stylelint-module
'@nuxtjs/stylelint-module',
'@nuxtjs/vuetify',
// Doc: https://github.com/nuxt-community/moment-module#readme
'@nuxtjs/moment',
// Doc: https://github.com/nuxt-community/dayjs-module
'@nuxtjs/dayjs',
],
/*
** Nuxt.js modules
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@nuxtjs/axios": "^5.12.2",
"@nuxtjs/moment": "^1.6.1",
"@nuxtjs/dayjs": "^1.2.0",
"@nuxtjs/proxy": "^2.0.1",
"@nuxtjs/pwa": "^3.0.2",
"nuxt": "^2.14.5"
Expand Down
7 changes: 4 additions & 3 deletions frontend/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@
</template>

<script>
import relativeTime from 'dayjs/plugin/relativeTime'
export default {
data() {
return {
Expand Down Expand Up @@ -229,6 +231,7 @@ export default {
},
async mounted() {
this.$dayjs.extend(relativeTime)
await this.getData()
},
Expand All @@ -248,9 +251,7 @@ export default {
},
getRelativeTimestamp(timestamp) {
return timestamp !== null
? this.$moment(timestamp).startOf('minute').fromNow()
: ''
return timestamp !== null ? this.$dayjs(timestamp).fromNow() : ''
},
editItem(item) {
Expand Down
59 changes: 15 additions & 44 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,14 @@
consola "^2.15.0"
defu "^3.1.0"

"@nuxtjs/dayjs@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@nuxtjs/dayjs/-/dayjs-1.2.0.tgz#5c2ddb45092187532926469f3b825bce003f19e9"
integrity sha512-3SmiHKV8yaMAKII9pj7iYdboH8Xi9ekIXb21JaAQV+qIpLnb107w1EAO1y9Mylc0VVRA0GvxCHr9crPZ7cuuZw==
dependencies:
consola "^2.3.2"
dayjs "^1.8.9"

"@nuxtjs/eslint-config@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@nuxtjs/eslint-config/-/eslint-config-3.1.0.tgz#7e73aa08035a743b99e64ee4337cf526a09c9973"
Expand All @@ -1246,16 +1254,6 @@
consola "^2.11.3"
eslint-loader "^4.0.2"

"@nuxtjs/moment@^1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@nuxtjs/moment/-/moment-1.6.1.tgz#a4e98a861c9d21e34f983046143f4c9bb92bdb7c"
integrity sha512-Mo2/3NQB0XryMQuNCTVnAclrDvt9I9sr6dwVm56KhYCoiWTKgQ78tDV9tmrxw7lahw1IBwyPGhw+3pwkM4phAA==
dependencies:
moment "^2.25.3"
moment-locales-webpack-plugin "^1.2.0"
moment-timezone "^0.5.28"
moment-timezone-data-webpack-plugin "^1.3.0"

"@nuxtjs/proxy@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@nuxtjs/proxy/-/proxy-2.0.1.tgz#2469b6e316311aa8c60d348502a54bfe6d5536aa"
Expand Down Expand Up @@ -2782,7 +2780,7 @@ connect@^3.7.0:
parseurl "~1.3.3"
utils-merge "1.0.1"

consola@^2.10.0, consola@^2.10.1, consola@^2.11.3, consola@^2.12.1, consola@^2.14.0, consola@^2.15.0, consola@^2.6.0, consola@^2.9.0:
consola@^2.10.0, consola@^2.10.1, consola@^2.11.3, consola@^2.12.1, consola@^2.14.0, consola@^2.15.0, consola@^2.3.2, consola@^2.6.0, consola@^2.9.0:
version "2.15.0"
resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.0.tgz#40fc4eefa4d2f8ef2e2806147f056ea207fcc0e9"
integrity sha512-vlcSGgdYS26mPf7qNi+dCisbhiyDnrN1zaRbw3CSuc2wGOMEGGPsp46PdRG5gqXwgtJfjxDkxRNAgRPr1B77vQ==
Expand Down Expand Up @@ -3173,6 +3171,11 @@ cyclist@^1.0.1:
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=

dayjs@^1.8.9:
version "1.8.36"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.36.tgz#be36e248467afabf8f5a86bae0de0cdceecced50"
integrity sha512-3VmRXEtw7RZKAf+4Tv1Ym9AGeo8r8+CjDi26x+7SYQil1UqtqdaokhzoEJohqlzt0m5kacJSDhJQkG/LWhpRBw==

de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
Expand Down Expand Up @@ -5613,11 +5616,6 @@ lodash._reinterpolate@^3.0.0:
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=

lodash.difference@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.difference/-/lodash.difference-4.5.0.tgz#9ccb4e505d486b91651345772885a2df27fd017c"
integrity sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=

lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
Expand Down Expand Up @@ -5734,7 +5732,7 @@ make-dir@^2.0.0:
pify "^4.0.1"
semver "^5.6.0"

make-dir@^3.0.0, make-dir@^3.0.2:
make-dir@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
Expand Down Expand Up @@ -6048,33 +6046,6 @@ mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1:
dependencies:
minimist "^1.2.5"

moment-locales-webpack-plugin@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/moment-locales-webpack-plugin/-/moment-locales-webpack-plugin-1.2.0.tgz#9af83876a44053706b868ceece5119584d10d7aa"
integrity sha512-QAi5v0OlPUP7GXviKMtxnpBAo8WmTHrUNN7iciAhNOEAd9evCOvuN0g1N7ThIg3q11GLCkjY1zQ2saRcf/43nQ==
dependencies:
lodash.difference "^4.5.0"

moment-timezone-data-webpack-plugin@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/moment-timezone-data-webpack-plugin/-/moment-timezone-data-webpack-plugin-1.3.0.tgz#8d5b7ffe42f0506933195779063a74cfff11aab1"
integrity sha512-0V0xnHZpdHLsSerIQ2yNEPBC3uJWfU/zNT3nB0PO+tjmGHuNeUWqNDiw7ZpLo54uER6/OAE75EJ7ThmlwkGuZw==
dependencies:
find-cache-dir "^3.0.0"
make-dir "^3.0.0"

moment-timezone@^0.5.28:
version "0.5.31"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.31.tgz#9c40d8c5026f0c7ab46eda3d63e49c155148de05"
integrity sha512-+GgHNg8xRhMXfEbv81iDtrVeTcWt0kWmTEY1XQK14dICTXnWJnT0dxdlPspwqF3keKMVPXwayEsk1DI0AA/jdA==
dependencies:
moment ">= 2.9.0"

"moment@>= 2.9.0", moment@^2.25.3:
version "2.28.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.28.0.tgz#cdfe73ce01327cee6537b0fafac2e0f21a237d75"
integrity sha512-Z5KOjYmnHyd/ukynmFd/WwyXHd7L4J9vTI/nn5Ap9AVUgaAE15VvQ9MOGmJJygEUklupqIrFnor/tjTwRU+tQw==

move-concurrently@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
Expand Down

0 comments on commit 597d6f3

Please sign in to comment.