0

MVVM now() function

asked 2018-03-23 01:18:32 +0800

lramellavotta gravatar image lramellavotta flag of Italy
200 1 8

Hi, what is the function to return currentdate in mvvm?

this my example:

style="@load(UtTel.data_visita gt getCurrentLocale() ? 'background-color: red;' : 'background-color:;')">

Thanks, Luca

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-03-23 10:11:58 +0800

hawk gravatar image hawk
2210 1 5
http://hawkphoenix.blogsp... ZK Team

Since java.util.Calendar is an abstract class, EL can't import it. So you can't call it directly in a data binding expression.

You can implement a static method to call Calendar e.g.

static public Date now(){
    return Calendar.getInstance().getTime();
}

Then call this method like @init(MyDateUtil.now())

link publish delete flag offensive edit
0

answered 2018-03-24 01:40:56 +0800

lramellavotta gravatar image lramellavotta flag of Italy
200 1 8

Thank you Hawk. Luca

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2018-03-23 01:18:32 +0800

Seen: 12 times

Last updated: Mar 24