Hello! I am working on Laravel project I have a form for invoices which include two date fields along with other fields. The two dates are named start_date and end_date. I want to select the end date based on start date which date should be the next month just one day before. For example .. I set the start date to 10 of March then the end date should be 9th of April. one day before the selected date of next month
My fields are..
<div class="col-lg-6">
<div class="form-group">
<label>Start Date</label>
<input class="form-control" type="date" name="start_date" value="{{old('start_date') }}">
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label>End Date</label>
<input class="form-control" type="date" name="end_date" value="{{ old('end_date') }}">
</div>
</div>
How can this be done and should it be through the java script or can it be in controller. If we can do it in controller then I sure that we will not need the end date field and that will be no problem.. Thanks in advance!