Skip to content

Cannot register lang with CommonJS module in express project #251

Open
@Alxtaz

Description

@Alxtaz

Hi,

I can't register the french language in my project, this is what i have done:

const fr = require('timeago.js/lib/lang/fr');
const timeago = require('timeago.js');

timeago.register('fr', fr);
timeago.format('2016-06-12', 'fr')

I got an error message: TypeError: localeFunc is not a function

However, in the filetimeago.js/lib/index there is en_US and zh_CN registered by default so if i register a new fr lang it works.

But every time i will push to production and install all my modules with npm install it will erase my configuration.

Am i missing something ? Thanks for your time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions