Date update on Laravel

Asked

Viewed 267 times

1

I would like to change the value of the date field at the time of a data edit. I can bring all values except the date.

I’m using the Form:: of Laravel:

{!! Form::label('dtemissao','Data de Emissão') !!}
{!! Form::input('date','dtemissao',$FinContaspagar[0]["DtEmissao"]->format("d/m/Y"), ['class' => 'form-control']) !!}<br />

I’m using the $FinContaspagar[0]["DtEmissao"]->format("d/m/Y") to change the default value of dd/mm/yyyy, but I was not successful in the change of value.

Does anyone have any solution?

1 answer

1


Use the format: Y-m-d, example:

<input type="date" value="{{$data->format('Y-m-d')}}">

in your code:

{!! Form::label('dtemissao','Data de Emissão') !!}
{!! Form::input('date','dtemissao',$FinContaspagar[0]["DtEmissao"]->format('Y-m-d')) !!}
  • 1

    It worked @Virgilio Novic thanks!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.