Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fix hydration issues caused by dayjs (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically authored Nov 29, 2023
1 parent 4856a6a commit 03967d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/assets/styles/defaults.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body {
--font-weight-title: var(--font-weight-extrabold);
}

a.uncolored {
a {
color: inherit;
text-decoration: none;
}
Expand Down
11 changes: 7 additions & 4 deletions lib/components/base/ProjectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
class="stat consumes-click"
>
<span class="label"><HistoryIcon /></span>
<span class="value">{{ dayjs(updatedAt).fromNow() }}</span>
<span class="value">{{ fromNow(updatedAt) }}</span>
</span>
<span
v-else
Expand All @@ -57,7 +57,7 @@
class="stat consumes-click"
>
<span class="label"><CalendarIcon /></span>
<span class="value">{{ dayjs(createdAt).fromNow() }}</span>
<span class="value">{{ fromNow(createdAt) }}</span>
</span>
<div class="tags">
<TagIcon />
Expand All @@ -80,8 +80,6 @@ import {
} from '@'
import { useVIntl, defineMessages } from '@vintl/vintl'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
dayjs.extend(relativeTime)
const vintl = useVIntl()
const { formatMessage } = vintl
Expand Down Expand Up @@ -202,6 +200,11 @@ defineProps({
required: false,
default: null,
},
fromNow: {
type: Function,
required: false,
default: (x) => x,
},
})
</script>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "omorphia",
"type": "module",
"version": "0.8.0",
"version": "0.8.1",
"files": [
"dist",
"locales"
Expand Down

0 comments on commit 03967d4

Please sign in to comment.