This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

date format within conditional test  RSS feed

 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, wondering if anyone can help me with this..

I'm outputting a date currently using..

${empty order.expiryDate ? "Non expiring" : order.expiryDate}

I want to also use fmt:formatDate.. Not sure how to use both the conditional test as well as fmt: tag..

Any suggestions..
[ September 06, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two ways spring to mind:

Since you cannot embed an action such as <fmt:formatDate> in an EL expression, switch to using <c:if> rather than the terniary operator.

or

Set the formatted date as a scoped variable prior to the terniary operator expresions, which uses one of the fixed string or stored date.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, never mind that last one... I see that you're testing for null.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!