modify locale, timestamps
This commit is contained in:
parent
92892f3cf9
commit
ffb981b854
3 changed files with 4 additions and 6 deletions
|
@ -10,6 +10,7 @@ const config: QuartzConfig = {
|
|||
provider: "google",
|
||||
tagId: "G-JVXFC0DCRE",
|
||||
},
|
||||
locale: "ja-JP",
|
||||
baseUrl: "kinoshita-lab.github.io/public_notes",
|
||||
ignorePatterns: ["private", "templates", ".obsidian", "obsidian_templates_"],
|
||||
defaultDateType: "modified",
|
||||
|
|
|
@ -24,6 +24,7 @@ export default ((opts?: Partial<ContentMetaOptions>) => {
|
|||
|
||||
if (text) {
|
||||
const segments: string[] = []
|
||||
segments.push("Last updated: ")
|
||||
|
||||
if (fileData.dates) {
|
||||
segments.push(formatDate(getDate(cfg, fileData)!, cfg.locale))
|
||||
|
|
|
@ -18,12 +18,8 @@ export function getDate(cfg: GlobalConfiguration, data: QuartzPluginData): Date
|
|||
return data.dates?.[cfg.defaultDateType]
|
||||
}
|
||||
|
||||
export function formatDate(d: Date, locale: ValidLocale = "en-US"): string {
|
||||
return d.toLocaleDateString(locale, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "2-digit",
|
||||
})
|
||||
export function formatDate(d: Date, locale: ValidLocale = "sv-SE"): string {
|
||||
return d.toLocaleDateString(locale)
|
||||
}
|
||||
|
||||
export function Date({ date, locale }: Props) {
|
||||
|
|
Loading…
Reference in a new issue