Access the current date in a conditional method

Forums for specific tips, techniques and example code
User avatar
rolly
Posts: 11
Joined: Mon Aug 17, 2009 9:08 am

Access the current date in a conditional method

Postby rolly » Thu Aug 20, 2009 2:32 pm

Is anyone aware of a way I can get access to the current date in a conditional method?
I obviously can't declare a 'Date' variable, nor can I access the app.actualTimeServer type methods.
I'm sure there must be some way to do this.

Thanks
Roland

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Access the current date in a conditional method

Postby BeeJay » Thu Aug 20, 2009 2:37 pm

I believe the reason this is blocked is because they need a "trigger" to re-evaluate a condition.

If use of dates was allowed as part of the condition, then you could have the situation where an object no longer meets the condition simply as a result of elapsed time, but because no actual update has occurred they would have no "trigger" for re-evaluation of the condition.

Cheers,
BeeJay.

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Access the current date in a conditional method

Postby BeeJay » Thu Aug 20, 2009 2:41 pm

I should make it clear that in my posting I was referring to when a condition has been used as a constraint on an automatic inverse. Obviously you can have conditions that are never used as a constraint, but the same enforcement rules need to apply regardless in case it is ever used as a constraint in the future.

Cheers,
BeeJay.

User avatar
rolly
Posts: 11
Joined: Mon Aug 17, 2009 9:08 am

Re: Access the current date in a conditional method

Postby rolly » Thu Aug 20, 2009 4:48 pm

Thanks BeeJay, I must admit that I perhaps hadn't thought through my use of dates in conditions far enough, so thanx for the extra info.

So under the hood I would have to assume that jade re-evaluates conditional methods which are used as constraints when any of the attributes or references touched in the conditional method change and must setup some sort of internal triggers?

Roland


Return to “Tips and Techniques”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron