I can't get my date to display without the time in an HTML table. This is my code.
<td input type={Date}>{call.date}</td>
The date gets entered by a Date Picker as mm/dd/yyyy but us displayed like this 2019-09-25T00:00:00
a JS date will always contain the time data even if you didn't provide the time, for the display of the datepicker depends on the datepicker settings/configurations. or you can handle it manually on your side too.
if call.date
is a string and contains ISO Date string, then you can do this to display date without time:
<td input type={Date}>{call.date.substring(0, 10)}</td>
or other ways:
// Parse into JS date object
const date = new Date(call.date)
...
<td input type={Date}>{date.toISOString().substring(0, 10)}</td>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With