I am working in laravel and I want to show in my Bootstrap Datepicker field a date in a format (dd / mm / yyyy) but I want to store it in format (yyyy / mm / dd).
Is there any property in Datepicker to do that? This is my input:
<div class="form-group">
<label for="fecha_nac"></label>
<input type="text" class="form-control CalendarioDP"
name="fecha_nac" placeholder="Colocar fecha"
value="{{ Carbon\Carbon::now()->formatLocalized('%d/%m/%Y') }}">
</div>
My Script:
<script>
$('.CalendarioDP').datepicker({
format: "dd/mm/yyyy",
language: "es",
});
</script>
When I leave the format in the script in this way, the date is displayed and stored in a format (dd / mm / yyyy)
I want to store it in (yyyy / mm / dd).
I have used "Torzer DateTime Mutator" and "protected $ dates", but I want to know if there is a simple DaterPicker property to declare once in the script and not specify each field I want to convert as Torzer