#1501·foam

Note from js template - supporting locale

Author: mighty1231Created Aug 19, 2025Updated Sep 7, 2025
Labelsenhancement

Is your feature request related to a problem? Please describe.

Currently, setting locale via dayjs is done by using require('dayjs/locale/ko'), as the document says as this

dayjs-changing-locale. or dayjs-changing-locale-for-locally

but js-template seems not support this

  1. Putting require() gives Template contains potentially unsafe code... error.
  2. Just using dayjs().locale('ko').format('YYYY-MM-DD (dd)') gives 2025-08-19 (Tu), but I want to see '2025-08-19 (화)`

Describe the solution you'd like

Importing every dayjs's locale dependency to foam? but it may make foam extension size SO high.

Describe alternatives you've considered

I think, evaluating dd for locale, seems easy in Javascript, via adjusting 7 tokens using switch-case or Map. Put this related information as js note template's comment, another user may not upload this kind of issue.