[Zope] Still Plagued With Date Formatting Bug in Text Field

Dan Shafer pydan@danshafer.com
Wed, 01 May 2002 07:51:33 -0700


OK, thanks for the continuing help.

I'm generating the contents of this particular field in a DTML Document 
inside a <FORM> tag with this line (beginning and ending angle brackets 
removed to avoid rendering problems)::

input type="text" name="start_date" value=<dtml-var 
"(_.DateTime().strftime(:%b %d, %Y"))">

As I think I said in a previous note, but just for the sake of 
completeness, if I change tthat to use a textarea object instead of a text 
field, the date displays correctly. The text field is more than wide enough 
to accommodate the entire string.

Thanks for any suggestions. This one has me completely baffled.

At 09:24 AM 5/1/2002 -0400, Casey Duncan wrote:
>On Wednesday 01 May 2002 12:58 am, Dan Shafer allegedly wrote:
>[snip]
> > >
> > >Any chance your field is rendering as:
> > >
> > >  <input type=text name=start_date value=Apr. 30, 2002>
> > >
> > >instead of:
> > >
> > >  <input type=text name=start_date value="Apr. 30, 2002">
> >
> > I suppose that's possible. There are no quotation marks showing in the
> > field. But if I'm using strftime(), I don't see how this could'should be
> > happening.
>
>If the quotes are missing, then that is your problem. strftime won't put
>quotes around it for you. How are you generating this html? ZPT, DTML or
>Python?
>
>Show us the source code of your template.
>
>-Casey