bound data formatting for view

55 views
Skip to first unread message

gsb

unread,
May 8, 2012, 9:21:13 PM5/8/12
to Agility.js
A simple task I am sure, but what would be a good way to format a time-
stamp field for display in a view? That is, each record has a date/
time stamp as a long integer and the data field is bound to a display
'label' field. But I would like to display it as a formatted date.
What would be the best approach in Agility?

Thanks, Greg.

Bertrand Mansion

unread,
Nov 5, 2012, 6:20:54 AM11/5/12
to agil...@googlegroups.com
Hi,

I would also like to know if there is a recommended way to do that.

I am just starting with the framework. I would expect something like the following to work, but it's not implemented yet:

<span data-bind="time | date(&, 'Y-m-d')">

The date function would be defined globally or maybe in the view (probably using the 'moment' library).

Greg, if you found a solution, can you please share it with me ?

Thank you,

Bertrand

Golgote

unread,
Nov 5, 2012, 7:17:05 AM11/5/12
to agil...@googlegroups.com
Hi,
I'd also be interested to know if there is a way to do that with Agilityjs.
Greg, did you find a solution ?

Thanks, Bertrand

GregBaker

unread,
Nov 5, 2012, 11:19:22 AM11/5/12
to agil...@googlegroups.com
@Bertrand & @Golgote

Sorry for the delay in responding.
I have not, for I have not been using Agility for a while.
I needed a "mobile" solution with out the "old browser bloat" of jQuery.

Do not get me wrong: jQuery is great and has many problems solved "out of the box" so to speak.
But still, I strive to minimize unnecessary framework bells and whistles for production.
jQuery simply does not lend itself to this goal. It is great as designed, but just not for that.

Greg
Reply all
Reply to author
Forward
0 new messages