alert(parseInt(new Date().toLocaleString('es', {month:'numeric'})));
This code always return 'NaN' on IE
why is this?
how can i solved only using vanilla javascript.
alert(parseInt(new Date().toLocaleString('es', {month:'numeric'})));
This code always return 'NaN' on IE
why is this?
how can i solved only using vanilla javascript.
var date = new Date();
var month = date.getMonth() + 1; //Months are zero based
This should work for you to get the month.