Im on node.js editing a server side file and I want to get the date in mexican spanish format like this:
const bdate = new Date(1980, 4-1, 3);
const birthdate = bdate.toLocaleString('es-MX', { month: 'short', year : 'numeric', day : 'numeric' });
console.log(birthdate);
but this produces Apr 3, 1980
whereas it should be: 3-abr-1980
This code works fine on a client side file but not here. What is wrong here?
Thanks.