Since I updated node server to last stable version date strings aren't displayed as before.
SERVER: Running node on centOS 7 (UNIX) with Nodejs v10.14.2
LAPTOP: Running node on macOS 10.14.2 with Nodejs v8.5.0
The code is the same in sever and laptop but, the output in server is wrong, date is being displayed in English by default.
I have tried to change language. Laptop web changes and Server web doesn't.
<code>var id = req.params.id;
db.getEvent(database, id, req.user.orchestra, function (document) {
var result = {
uuid: document.uuid,
type: document.type,
description: document.desc,
date: {
long: new Date(document.when).toLocaleDateString('es', { "weekday": "long", "year": "numeric", "month": "long", "day": "2-digit" }),
short: new Date(document.when).toLocaleDateString('es', { year: 'numeric', month: '2-digit', day: '2-digit' })
},
time: new Date(document.when).toLocaleTimeString('es', { "minute": "2-digit", "hour": "2-digit" }) + " CEST",
plus: new Date(parseInt(document.when) + parseInt(document.plus)).toLocaleTimeString('es', { "minute": "2-digit", "hour": "2-digit" }) + " CEST",
location: document.loc,
schedule: document.schedule
};
res.json(result);
});</code>
Server output is: Friday, December 21, 2018
Expected server output: viernes, 07 de diciembre de 2018
Laptop output is: viernes, 07 de diciembre de 2018