Have you looked at format functions.
May 27, 2016
6
Level 5
How to change day of date
controller:
public function store(ContractRequest $request,$operatorId)
{
//dd($request->all());
$contractData = $request->all();
$contractData['operator_id'] = $operatorId;
if ($this->contract->create($contractData)) {
return redirect()->route('admin.operator.{id}.contracts.index',[$operatorId])->with('success', 'Contract
successfully
created.');
}
return redirect()->route('admin.contracts.index')->with('error', 'Contract could not be created.');
}
view:
<div class="form-group">
{!! Form::label('title', 'Start Date:', ['class'=>'col-sm-2 control-label'])!!}
<div class="col-sm-7">
{!! Form::date('start_date',null, ["class"=>"form-control",'required'])!!}
</div>
</div>
<div class="form-group">
{!! Form::label('title', 'End Date:', ['class'=>'col-sm-2 control-label'])!!}
<div class="col-sm-7">
{!! Form::date('end_date',null, ["class"=>"form-control"])!!}
</div>
</div>
<div class="form-group">
{!! Form::label('title', 'Remarks:', ['class'=>'col-sm-2 control-label'])!!}
<div class="col-sm-7">
{!! Form::textarea('remark',null, ["class"=>"form-control",'cols'=>'10','rows'=>'5'])!!}
</div>
</div
my question :This is contract form and generally contract that should start form 01 day and end at30,29 or 31 day of month. if user select 2016-2-4as start date and 2017-05-31end date from date picker then start date should be saved as2016-2-1.How can make this ,start dateday should always be one ie01
start data 2016-o2-o4 should be saved as2016-02-01 ie 01 at end for day
Please or to participate in this conversation.