0
I need to format the date to 00-00-0000, the code below is view of the .blade.php
<td class="col-sm-2" data-bind="text: created_at"></td>
created_at is database field.
just to illustrate, to limit characters I got so, but with date I can’t
<td class="col-sm-3" data-bind="text: plot ? plot.trunc(150) : null"></td>
I appreciate any help
I believe your question lacks information, I’ve never seen this attribute
data-bind
in Laravel, for example, and after a brief search I found this js api: http://knockoutjs.com/index.html– MarceloBoni
Something else comes to mind, apparently you just want to show the field coming from the database, formatted correct? Why don’t you do something like that? This way you decrease the load of js in your front-end, and since you will get the data in the bd, you already have it formatted
– MarceloBoni
Of course, this will taste, but when I want to format some data to display in front-end I prefer to do directly in my model, Exp: in my
class product
have apublic function formatedPriece()
which has the following code:{ return ( is_null($this->price) ? trans('price-empty') : "R$ ".number_format($this->price, 2, ',', '.'); }
– MarceloBoni
Besides the Laravel is using other things ... could make this code available in full?
– novic
the problem is that this part is all knockoutjs and your example as or other things I tried didn’t work. I asked for help on knockoutjs forum
– user100984