Re: Date Values




It shouldn't be hard to subclass the TieScalar code to do the conversion
inline.  Then you just tell it the mode at creation time (or whatever)
and let it convert to/from the user's preferred representation.  Use
epoch seconds and Date::Manip is your friend.

On Thu, 2004-06-03 at 00:17, Daniel Kasak wrote:
I'm getting back to the idea of using Gtk2::TieScalar and 
Gtk2::TieArrayRef to tie fields on a form to an array, and use a helper 
object to load the array and handle updates.

We have a problem with date fields. People in Australia are expecting 
dates in the format dd-mm-yyyy, and everything else seems to be 
yyyy-mm-dd. To get around this, I have been using GtkCalendar, so they 
can click the date and not worry about manual input. But this won't work 
with a GtkCalendar, will it?

I've had a look at Gtk2::CellRendererDate in the examples directory ( 
which does a cool pop-down GtkCalendar ), but this only applies to cells 
in a TreeView, doesn't it? I want to have these laid out via glade on 
the form.

I can use MySQL's date_format() to format dates so they *look* familiar 
to people, but updating the database from data entered by people is a 
problem, unless my helper object somehow knows it's dealing with a date, 
and reverses the month / day fields.

What options do I have?

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]