mardi 17 mai 2016

Setting value datetime-local on laravel

I want to add value in my edit form, with the value take from my database. but I don't know how to add value in the form of type datetime-local. I've tried but not appear.

here my view :

<div class='form-group col-sm-6'>
                        <label>Date Start</label>
                        <input class='form-control' value='' readonly />
                        <input type='datetime-local' class='form-control' name='date_start' value='' required/>
                    </div>
                    <div class='form-group col-sm-6'>
                        <label>Date End</label>
                        <input  class='form-control' value='' readonly />
                        <input type='datetime-local' class='form-control' name='date_end' value='' required/>
                    </div>

and here my controller :

public function postEditSave($id) {
        $simpan= array();
        $simpan['date_start']=Request::input('date_start');
        $simpan['date_end']=Request::input('date_end');
        $simpan['condition_status']=Request::input('condition_status');
        $simpan['id_cms_users']=Request::input('id_cms_users');
        $simpan['id_cms_companies']=Request::input('id_cms_companies');

        DB::table('log_patrols')->where('id', $id)->update($simpan);
        Session::flash('edit', 'Berhasil merubah data');
        return redirect('patrols');
    }

and this my database :

here

and for notice my date_start and date_end column is type datespam

can someone give me solution ? or did any other form input type can i use for my project ? which could take a date and time data directly? for to change type datetime-local ?

thanks...

sorry for my bad english.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire