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
3250 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
1 follower

RSS

Stats

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

Seen: 13 times

Last updated: Mar 24 '18

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More