File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -357,13 +357,19 @@ export async function renderFiles(
357357 // Set the date locale for this render
358358 // Used for date formatting
359359 initDayJsPlugins ( ) ;
360- if (
361- context . format . metadata [ kLang ] &&
362- typeof ( context . format . metadata [ kLang ] ) === "string"
363- ) {
360+ const resolveLang = ( ) => {
361+ const lang = context . format . metadata [ kLang ] ||
362+ options . flags ?. pandocMetadata ?. [ kLang ] ;
363+ if ( typeof ( lang ) === "string" ) {
364+ return lang ;
365+ } else {
366+ return undefined ;
367+ }
368+ } ;
369+ const dateFormatLang = resolveLang ( ) ;
370+ if ( dateFormatLang ) {
364371 await setDateLocale (
365- options . flags ?. pandocMetadata ?. [ kLang ] as string ||
366- context . format . metadata [ kLang ] as string ,
372+ dateFormatLang ,
367373 ) ;
368374 }
369375
You can’t perform that action at this time.
0 commit comments