Add binding declaration example for formatters.
Showing
1 changed file
with
10 additions
and
4 deletions
... | @@ -109,13 +109,19 @@ Available bindings out-of-the-box: | ... | @@ -109,13 +109,19 @@ Available bindings out-of-the-box: |
109 | 109 | ||
110 | *Formatters* are simple one-way functions that mutate the incoming value of a binding. You can use them to format dates, numbers, currencies, etc. and because they work in a similar fashion to the Unix pipeline, the output of each feeds directly as input to the next one, so you can stack as many of them together as you like. | 110 | *Formatters* are simple one-way functions that mutate the incoming value of a binding. You can use them to format dates, numbers, currencies, etc. and because they work in a similar fashion to the Unix pipeline, the output of each feeds directly as input to the next one, so you can stack as many of them together as you like. |
111 | 111 | ||
112 | rivets.formatters.money = function(value){ | 112 | ``` |
113 | rivets.formatters.money = function(value){ | ||
113 | return accounting.formatMoney(value); | 114 | return accounting.formatMoney(value); |
114 | }; | 115 | }; |
115 | 116 | ||
116 | rivets.formatters.date = function(value){ | 117 | rivets.formatters.date = function(value){ |
117 | return moment(value).format('MMM DD, YYYY'); | 118 | return moment(value).format('MMM DD, YYYY'); |
118 | }; | 119 | }; |
120 | ``` | ||
121 | |||
122 | ``` | ||
123 | <span data-text="event.startDate | date"></span> | ||
124 | ``` | ||
119 | 125 | ||
120 | ## Usage Notes | 126 | ## Usage Notes |
121 | 127 | ... | ... |
-
Please register or sign in to post a comment