Re: How do you format a date using struts/iterate?
Any takers? Still looking for the answer to this one. I need to format a date. I have an array of beans I am iterating through, and the bean's method getDeliveryDate() returns a Date. Basically, how do I get the current object according to the iterator? If I had that object, I could perform the following formatting myself. DateFormat.getDateInstance(DateFormat.SHORT).format(orders[interator].getDeliveryDate()); Thank You, Bob Byron --- Bob Byron [EMAIL PROTECTED] wrote: How do you format a date using struts? I have a list of orders that I am logic:iterate'ing through. At one point I write out a date, but it is not in the format I want. I am using the following code: logic:iterate id=orders name=myOrders bean:write name=orders property=deliveryDate/ /logic:iterate How do I reformat the deliveryDate? I want to use something similar to the following, but I am not sure how to implement it in struts. %= DateFormat.getDateInstance(DateFormat.SHORT).format(orders[interator].getDeliveryDate()); % Thank You, Bob Byron __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
RE: How do you format a date using struts/iterate?
Why don't you use the datetime taglib? http://jakarta.apache.org/taglibs/doc/datetime-doc/intro.html -Original Message- From: Bob Byron [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 15, 2001 10:14 AM To: [EMAIL PROTECTED] Subject: Re: How do you format a date using struts/iterate? Any takers? Still looking for the answer to this one. I need to format a date. I have an array of beans I am iterating through, and the bean's method getDeliveryDate() returns a Date. Basically, how do I get the current object according to the iterator? If I had that object, I could perform the following formatting myself. DateFormat.getDateInstance(DateFormat.SHORT).format(orders[interator].getDel iveryDate()); Thank You, Bob Byron --- Bob Byron [EMAIL PROTECTED] wrote: How do you format a date using struts? I have a list of orders that I am logic:iterate'ing through. At one point I write out a date, but it is not in the format I want. I am using the following code: logic:iterate id=orders name=myOrders bean:write name=orders property=deliveryDate/ /logic:iterate How do I reformat the deliveryDate? I want to use something similar to the following, but I am not sure how to implement it in struts. %= DateFormat.getDateInstance(DateFormat.SHORT).format(orders[interator].getDel iveryDate()); % Thank You, Bob Byron __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: How do you format a date using struts/iterate?
Bob Byron [EMAIL PROTECTED] wrote: In your example below, the variable orders does not contain the iterator, but the single element of the iterator. You can use the attribute type of html:iterate to set the concrete class type to the variable orders. Any you should perhaps use the singular order for it. -- gR Any takers? Still looking for the answer to this one. I need to format a date. I have an array of beans I am iterating through, and the bean's method getDeliveryDate() returns a Date. Basically, how do I get the current object according to the iterator? If I had that object, I could perform the following formatting myself. DateFormat.getDateInstance(DateFormat.SHORT).format(orders [interator].getDeliveryDate()); Thank You, Bob Byron --- Bob Byron [EMAIL PROTECTED] wrote: How do you format a date using struts? I have a list of orders that I am logic:iterate'ing through. At one point I write out a date, but it is not in the format I want. I am using the following code: logic:iterate id=orders name=myOrders bean:write name=orders property=deliveryDate/ /logic:iterate How do I reformat the deliveryDate? I want to use something similar to the following, but I am not sure how to implement it in struts. %= DateFormat.getDateInstance(DateFormat.SHORT).format(orders[interator].getDeliv eryDate()); % Thank You, Bob Byron __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: How do you format a date using struts/iterate?
Thanks, that worked great! --- Gregor Rayman [EMAIL PROTECTED] wrote: Bob Byron [EMAIL PROTECTED] wrote: In your example below, the variable orders does not contain the iterator, but the single element of the iterator. You can use the attribute type of html:iterate to set the concrete class type to the variable orders. Any you should perhaps use the singular order for it. -- gR Any takers? Still looking for the answer to this one. I need to format a date. I have an array of beans I am iterating through, and the bean's method getDeliveryDate() returns a Date. Basically, how do I get the current object according to the iterator? If I had that object, I could perform the following formatting myself. DateFormat.getDateInstance(DateFormat.SHORT).format(orders [interator].getDeliveryDate()); Thank You, Bob Byron --- Bob Byron [EMAIL PROTECTED] wrote: How do you format a date using struts? I have a list of orders that I am logic:iterate'ing through. At one point I write out a date, but it is not in the format I want. I am using the following code: logic:iterate id=orders name=myOrders bean:write name=orders property=deliveryDate/ /logic:iterate How do I reformat the deliveryDate? I want to use something similar to the following, but I am not sure how to implement it in struts. %= DateFormat.getDateInstance(DateFormat.SHORT).format(orders[interator].getDeliv eryDate()); % Thank You, Bob Byron __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: How do you format a date using struts/iterate?
There is a very nice date taglib on jakarta. http://jakarta.apache.org/taglibs/doc/datetime-doc/intro.html I think this will work or it is at least close. logic:iterate id=orders name=myOrders bean:define id=deliveryDate name=orders property=deliveryDate/ dt:format pattern=MM/dd/ hh:mm date=%= deliveryDate % / /logic:iterate David --- Bob Byron [EMAIL PROTECTED] wrote: Thanks, that worked great! --- Gregor Rayman [EMAIL PROTECTED] wrote: Bob Byron [EMAIL PROTECTED] wrote: In your example below, the variable orders does not contain the iterator, but the single element of the iterator. You can use the attribute type of html:iterate to set the concrete class type to the variable orders. Any you should perhaps use the singular order for it. -- gR Any takers? Still looking for the answer to this one. I need to format a date. I have an array of beans I am iterating through, and the bean's method getDeliveryDate() returns a Date. Basically, how do I get the current object according to the iterator? If I had that object, I could perform the following formatting myself. DateFormat.getDateInstance(DateFormat.SHORT).format(orders [interator].getDeliveryDate()); Thank You, Bob Byron --- Bob Byron [EMAIL PROTECTED] wrote: How do you format a date using struts? I have a list of orders that I am logic:iterate'ing through. At one point I write out a date, but it is not in the format I want. I am using the following code: logic:iterate id=orders name=myOrders bean:write name=orders property=deliveryDate/ /logic:iterate How do I reformat the deliveryDate? I want to use something similar to the following, but I am not sure how to implement it in struts. %= DateFormat.getDateInstance(DateFormat.SHORT).format(orders[interator].getDeliv eryDate()); % Thank You, Bob Byron __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/