-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
date formatting and some fixes for filters
- Loading branch information
1 parent
f79e06a
commit 549f2f8
Showing
6 changed files
with
48 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { App as AppType, Plugin } from 'vue' | ||
import { Injection } from '@/utils/constants.ts' | ||
|
||
export class IntlService { | ||
private readonly _datetime: Intl.DateTimeFormat | ||
constructor() { | ||
this._datetime = new Intl.DateTimeFormat(['en-GB'], { | ||
month: 'short', | ||
year: 'numeric', | ||
day: 'numeric', | ||
}) | ||
} | ||
|
||
formatDate(date: Date): string { | ||
return this._datetime.format(date) | ||
} | ||
|
||
static initPlugin(): Plugin { | ||
return { | ||
install: (app: AppType) => { | ||
app.provide(Injection.Intl, new IntlService()) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import type { InjectionKey } from 'vue' | ||
import type { DialogsService } from '@/services/dialogs.ts' | ||
import type { IntlService } from '@/services/intl.ts' | ||
|
||
export const Injection = { | ||
DialogController: Symbol("dialogs-controller") as InjectionKey<DialogsService>, | ||
Intl: Symbol("intl") as InjectionKey<IntlService>, | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.