I have a datetimepicker() set with ID start_date that matches an input name. In the props, the format is specified as YYYY-MM-DD. I want to use this format for my API, but I want the user to see the date displayed in the format DD-MM-YYYY.
$('#start_date').datetimepicker({
format: 'YYYY-MM-DD'
});
I have utilized this code, but my desired outcome is to display the date as day-month-year (DD-MM-YYYY) while maintaining the value as year-month-day (YYYY-MM-DD). When I retrieve $('#start_date').val(), it should return YYYY-MM-DD.
EDIT: Here is the example code that I am currently using. This is what I am aiming for:
<div class="input-group date" id="start_date">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="far fa-calendar-alt"></i>
</span>
</div>
<input type="text" name="start_date" class="form-control"/>
</div>
## jquery
$('#start_date').datetimepicker({
// display --> DD-MM-YYYY
// value --> YYYY-MM-DD
});