-
-
Notifications
You must be signed in to change notification settings - Fork 240
feat: allow toggle relative dates on click DateTime
#847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
dc47efe
f2b5f33
926cf19
e7af59b
b944119
3d8a4be
a5f8164
f9f1e10
ef4a6d6
a56e4dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,9 @@ import DateTime from '~/components/DateTime.vue' | |||||||||||||||||||
| // Mock the useRelativeDates composable | ||||||||||||||||||||
| const mockRelativeDates = shallowRef(false) | ||||||||||||||||||||
| vi.mock('~/composables/useSettings', () => ({ | ||||||||||||||||||||
| useRelativeDates: () => mockRelativeDates, | ||||||||||||||||||||
| useRelativeDates: () => ({ | ||||||||||||||||||||
| relativeDates: mockRelativeDates, | ||||||||||||||||||||
| }), | ||||||||||||||||||||
|
Comment on lines
+8
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add
✅ Suggested fix vi.mock('~/composables/useSettings', () => ({
useRelativeDates: () => ({
relativeDates: mockRelativeDates,
+ toggleRelativeDates: () => {
+ mockRelativeDates.value = !mockRelativeDates.value
+ },
}),
useSettings: () => ({
settings: ref({ relativeDates: mockRelativeDates.value }),
}),
useAccentColor: () => ({}),
}))📝 Committable suggestion
Suggested change
|
||||||||||||||||||||
| useSettings: () => ({ | ||||||||||||||||||||
| settings: ref({ relativeDates: mockRelativeDates.value }), | ||||||||||||||||||||
| }), | ||||||||||||||||||||
|
|
||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.