Skip to content

Setting the locale of Handlebars Intl using Express #89

Open
@ghost

Description

I'm using express, express-handlebars and handlebars-intl and I would like to change the default "en" locale to another (like "it").

I read that this plugin uses Intl.DateTimeFormat to formats. In this specific case how can I edit things like locale, timezone, date formats, etc..

    const hbs = exphbs.create({ extname: '.hbs' });
    app.engine(hbs.extname, hbs.engine);
    HandlebarsIntl.registerWith(hbs.handlebars); // Handlebars Intl Plugin
    app.set('view engine', hbs.extname);
    app.set('views', path.join(__dirname, './views/pages'));

Final goal:

Correctly renders with Handlebars this datetime {{formatDate time}} using my specified locale

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