I'm new on PHP and everything in general, I'm building an application where a date picker is shown. I want to submit the date following a specific format (year : "y" and month : "m") to end up with a url like http://localhost/index.php?m=06&y=2019...
the datepicker i'm using is https://getdatepicker.com/5-4/
and the code:
HTML:
<div class="col-xl-4 col-md-6 col-12">
<div class="float-left">
<form action="">
<div class="input-group">
<input name="datepicker" id="datepicker" class="form-control py-2 border-right-0 borderdate-pickerwidth:auto" value="04/01/2021" />
<button class="input-group-append">
<i class="mdi mdi-calendar align-middle font-c-x-large border-left-0 border px-2"></i>
</button>
</div>
</form>
</div>
</div>
JS:
$(function () {
$('#datepicker').datetimepicker({
format: 'DD/MM/YYYY'
});
});
Actually if I submit a form the value is:
?datepicker=04%2F01%2F2021
but I want:
?m=01&y=2021
So my question is: How can I submit the information displayed on the datepicker and format it as commented above?
Thank you in advice.