0

I'm making a report, the report has a input of type date that always is going to have the today's date.

I tried someting like this

let date = new Date();
$('#fecha').val(date.toISOString()); //fecha is my input

It put something like this in the input

2019-08-20T10:51

But I just want to show the date without time. I dont want to add ui Jquery plugin to my project.

Charlie
  • 22,886
  • 11
  • 59
  • 90
Johnatan De Leon
  • 156
  • 1
  • 10

1 Answers1

1

How about something like below,

let date = new Date();
$('#fecha').val(date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate()); 
Saad Sahibjan
  • 300
  • 1
  • 6