You can simply use the function .locale()after parsing the correct language from the query (but you at least sent the language header)
const moment = require('moment');
const language = getLanguageFromRequest(req);
moment.locale(language);
but it might be better to handle it in a browser rather than in a backend.
source
share