Skip to content

Note from js template - supporting locale #1501

@mighty1231

Description

@mighty1231

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions