Doing string manipulation on the value

278 views
Skip to first unread message

Nikhil Sabharwal

unread,
Apr 25, 2018, 5:26:36 PM4/25/18
to mustache.java
Hi,

I have a Mustache mode object which return date in string format. ex-   2018-04-24 at 17:00:00 PDT

I want to show only the date and not the time. How can I manipulate the mustache value ?

I am looking for something like - {{dueDate}}.split(" ")[0]  

Sam Pullara

unread,
Apr 25, 2018, 6:43:21 PM4/25/18
to mustac...@googlegroups.com
Every template should be backed by view class where you would put transforms like this rather than putting that logic in the template. This example is in one of my blog posts on the subject:


--
You received this message because you are subscribed to the Google Groups "mustache.java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mustachejava+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages