-
Notifications
You must be signed in to change notification settings - Fork 755
Description
Problem
The FOAM_DATE_DAY_NAME_SHORT and FOAM_DATE_DAY_NAME variables use the system's default locale, which causes issues for users who want English day names (Mon, Tue, etc.) but have their OS set to a different language.
Currently, the code uses:
this.foamDate.toLocaleString('default', { weekday: 'short' })This means users with Japanese, German, or other non-English locales get localized day names (e.g., "月" instead of "Mon").
Related Issues
${FOAM_DATE_*}variable expansion is dependent on system locale. #919 - Similar issue was reported and marked as fixed in v0.17.8, but the problem persists forFOAM_DATE_DAY_NAME_SHORTandFOAM_DATE_DAY_NAMEvariables- Note from js template - supporting locale #1501 - Related locale support request for js templates
Why This Matters
The deprecated foam.openDailyNote.filenameFormat setting uses the dateformat library which outputs English day names regardless of locale. Users migrating to the new template-based approach (as recommended) lose this behavior.
For users who have existing daily notes with English day names like:
2023-01-22 (Sun).md2023-01-23 (Mon).md
The new template system creates files with localized names:
2026-01-05 (月).md
This breaks consistency with existing notes.
Proposed Solution
Add a setting to specify the locale for date variables, for example:
{
"foam.dateLocale": "en-US"
}Or add new variables with explicit English locale:
FOAM_DATE_DAY_NAME_ENFOAM_DATE_DAY_NAME_SHORT_EN
Environment
- Foam version: latest
- OS: macOS (Japanese locale)
- VS Code version: latest
Workaround
Currently using the deprecated foam.openDailyNote.filenameFormat setting, but this will be removed in future versions.