On Friday 18 January 2008 04:32:25 pm Ed Leafe wrote:
> On Jan 18, 2008, at 4:37 PM, johnf wrote:
> > Update() will populate the dDateTextBox with
> > 01-01-01.
> > Which of course is not what I want to show my user.  I'd much prefer
> > a blank
> > control or what VFP displays "  /  /  "
> >
> >
> > If I do a double click on the control the calendar pops open but of
> > course the
> > year for the calendar is 01 (1901?).  I think it would be best if the
> > calendar dialog used today's date to start.
>
>       If you want to default to today, use this:
>
> import datetime
> biz.DefaultValues = {"myDateField", datetime.date.today}
>
> > I also can not use any of the shortcut keys.  Even when I force one
> > of the
> > short keys though (using my debugger) I get an exception  from
> > dDateTextBox.
> > NameError: name 'year' is not defined.  Which I think is coming from
> > the
> > following section of the code:
> > if isDateTime:
> >                     try:
> >                             ret = datetime.datetime(year, month, day, hr, 
> > mn, sec)
> >                     except:
> >                             if not testing:
> >                                     # Don't fill up the logs with error 
> > messages from tests that
> >                                     # are expected to fail.
> >                                     dabo.errorLog.write(_("Invalid datetime 
> > specified: %s") % val )
> >                             ret = None
> >             else:
> >                     try:
> >                             ret = datetime.date(year, month, day)
> >                     except:
> >                             if not testing:
> >                                     # Don't fill up the logs with error 
> > messages from tests that
> >                                     # are expected to fail.
> >                                     dabo.errorLog.write(_("Invalid date 
> > specified: %s") % val )
> >                             ret = None
> >             return ret
> >
> > I'm guessing that the 'year','month','day'  are not being defined
> > first.
>
>       I'm not seeing this, but then again, I'm not getting string values in
> my date Values, either. Let me look into it further.
>
> -- Ed

Now I recall why I did the bizobj.new().  I wanted to show the user a blank 
dDateTextBox control.  

Even with the update() or the self.Form.new(datasource) I still can't use the 
shortcut keys.

-- 
John Fabiani


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to