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",
|
provider: "google",
|
||||||
tagId: "G-JVXFC0DCRE",
|
tagId: "G-JVXFC0DCRE",
|
||||||
},
|
},
|
||||||
|
locale: "ja-JP",
|
||||||
baseUrl: "kinoshita-lab.github.io/public_notes",
|
baseUrl: "kinoshita-lab.github.io/public_notes",
|
||||||
ignorePatterns: ["private", "templates", ".obsidian", "obsidian_templates_"],
|
ignorePatterns: ["private", "templates", ".obsidian", "obsidian_templates_"],
|
||||||
defaultDateType: "modified",
|
defaultDateType: "modified",
|
||||||
|
|
|
@ -24,6 +24,7 @@ export default ((opts?: Partial<ContentMetaOptions>) => {
|
||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
const segments: string[] = []
|
const segments: string[] = []
|
||||||
|
segments.push("Last updated: ")
|
||||||
|
|
||||||
if (fileData.dates) {
|
if (fileData.dates) {
|
||||||
segments.push(formatDate(getDate(cfg, fileData)!, cfg.locale))
|
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]
|
return data.dates?.[cfg.defaultDateType]
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatDate(d: Date, locale: ValidLocale = "en-US"): string {
|
export function formatDate(d: Date, locale: ValidLocale = "sv-SE"): string {
|
||||||
return d.toLocaleDateString(locale, {
|
return d.toLocaleDateString(locale)
|
||||||
year: "numeric",
|
|
||||||
month: "short",
|
|
||||||
day: "2-digit",
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Date({ date, locale }: Props) {
|
export function Date({ date, locale }: Props) {
|
||||||
|
|
Loading…
Reference in a new issue