Skip to content

Dates not converting by locale #64

@barouchk

Description

@barouchk

When showing the month date like DD * YYYY and using current user locale, the locale not changed in momentjs static resource

this example is working: https://onecompiler.com/javascript/4472ruc6g

but when I'm debugging the package I found that the moment locale remains in 'en'.

not sure in the static resource is momentjs with locale

solution:
you can use: Formatted Date Time in the: timelineMonth component
like that:

<lightning-formatted-date-time value="2025-12-12" month="short" year="numeric"></lightning-formatted-date-time>
and transfer the date value as is with formatting in component: activityTimeline

line:                     monthItem.monthValue = moment(key).format("MMM  •  YYYY");
to:                     monthItem.monthValue = moment(key);

that way the visibility of the dates will run by the locale of the running user

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions