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

Jim Penny jpenny@universal-fasteners.com
Wed, 1 May 2002 11:11:58 -0400


On Wed, May 01, 2002 at 07:51:33AM -0700, Dan Shafer wrote:
> 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"))">
 Should be
 <input type="text" name="start_date" value="<dtml-var 
   "(_.DateTime().strftime("%b %d, %Y")>">

html parsing regards the first space not in a quoted object to
be a token, which if not a keyword is silently ignored.

So you input is being trucated after the first space.

jim Penny

> 
> 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
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>