Marketcircle    Forums  Hop To Forum Categories  Extending Daylite  Hop To Forums  Creating HUD Widgets    Short Date problem with a HUD
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Journeyman
Posted
I'm modifying Andy Warwick's great FTP Login HUD but I've run into a problem that I'm hoping has a simple solution.

My custom form has a number of date fields. When the form data is displayed in the HUD, the dates are long style, for lack of a better phrase. I wanted short dates. So I appended the .shortDate thing to the date field like so:

<li><strong>Date filed:</strong> <$formdata.datefile.shortDate$></li>

I then get a date like "3/13/07" which is what I want. The problem is that when the date field is empty on the custom form, the HUD locks ups and Daylite crashes. I'm wondering if there's a different way to change the code so that the shortDate works without having to use .shortDate for each date field. Seems like this could be set some other place but I don't know how.

Hope that's clear and that someone can help1
 
Posts: 60 | Registered: November 14, 2007Reply With QuoteEdit or Delete MessageReport This Post
Marketcircle Team
Picture of Ali Lalani
Posted Hide Post
Atticus,

Appending .shortDate is the right thing to do here. It's a bit strange that it's locking up when there's no value, but you could try this to avoid that:

<li><strong>Date filed:</strong> <$if formdata.datefile$><$formdata.datefile.shortDate$><$endif$></li>

This way it won't bother trying to put that value in if there is no value to swap in.
 
Posts: 108 | Registered: June 15, 2006Reply With QuoteEdit or Delete MessageReport This Post
Journeyman
Posted Hide Post
Thanks, Ali. That seems to work. There must be a better way than putting if/endifs around each data field, but that will have to work for now.
 
Posts: 60 | Registered: November 14, 2007Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

Marketcircle    Forums  Hop To Forum Categories  Extending Daylite  Hop To Forums  Creating HUD Widgets    Short Date problem with a HUD

© Copyright 2006 Marketcircle Inc. All rights reserved.