I want to know how I get a date from an input of type date in the format dd-(Month in English)-yy, an example would be:
function handleSubmit(event) {
event.preventDefault();
let fechaAFormatear = event.target.datePicker.value
// Algoritmo para formatear la fecha
//...
//...
//...
let fechaFormateada = fechaAFormatear
console.log(fechaFormateada) // => algun tipo de fecha con el formato dd-(Nombre del mes en ingles)-yy, ejemplo: 29-Jun-21
}
<form onSubmit="handleSubmit()">
<input id="datePicker" type="date" />
<input type="submit" />
</form>
This is just an example of how I want to achieve it, if you have any Regexp or if you can use any kind of help I would appreciate it, the thing is that I am new to JS and I am learning.