Hi,

First and foremost, the date parsing methods are not implemented in the wxPerl for the 2.9.x branch of wxWidgets. This is because the API for these methods changed completely from the 2.8 branch to the 2.9 branch. When the 2.9 branch was first created, the code you quoted was added to wxPerl simply to allow compilation with the new wxWidgets branch. I imagine the intention was to return to the code and implement the 2.9.x API at some point.

For myself, and I would guess previously Mattia, a full implementation on Wx::DateTime is a pretty low priority.

My view would be that you should use one of the many excellent Perl module groups for Date Time manipulation to parse and calculate date values. Use Wx::DateTime objects only to pass your values to and from the GUI methods and functions as necessary.

Not that it would have helped you in this case, but you have written code based on the 2.8.x wxWidgets API which would not work with the 2.9.x API anyway.

I'll make sure that the date parsing functions are on the 'todo' list, but I would highly recommend using your favourite dedicated Perl DateTime module set instead.

Regards

Mark




On 22/06/2013 15:22, Helen Craigman wrote:
In DateTime.xsp:
https://metacpan.org/source/MDOOTSON/Wx-0.9922/ext/datetime/XS/DateTime.xsp
lines 120-128, you find:
#if WXPERL_W_VERSION_LT( 2, 9, 0 )
     wxString ParseFormat( wxString date,
         wxString format = wxDefaultDateTimeFormat,
         const wxDateTime& dateDef = wxDefaultDateTimePtr );
     wxString ParseDate( wxString date);
     wxString ParseDateTime( wxString date);
     wxString ParseTime( wxString date);
     wxString ParseRfc822Date( wxString date);
#endif
What does that mean in respect of my OP?
Many TIA
Helen

    ----- Original Message -----
    *From:* Helen Craigman <mailto:ga0...@gmail.com>
    *To:* wxperl-users <mailto:wxperl-users@perl.org>
    *Sent:* Saturday, 22 June, 2013 13:05
    *Subject:* Is Wx::DateTime fully implemented in WxPerl?

    Dear esteemed wxPerl experts

    Is Wx::DateTime fully implemented in WxPerl?
    These three statements work fine:
    use Wx::DateTime;
    #...
    $date_to_wx = Wx::DateTime->new;
    # ...
    $time_from_ctrl->SetValue($time_from_wx); # (where $time_from_ctrl
    is a Wx::TimePickerCtrl)
    # ...
    $time_from_ctrl->GetValue($time_from_wx);
    But, when trying one of these:
    $timeformat = '%T';
    #...
    $time_from_wx = Wx::DateTime->ParseFormat('0:0:0', $timeformat);
    or trying:
    $time_from_wx = Wx::DateTime->ParseTime('0:0:0');
    it bumps with: "Can't locate object method "ParseFormat" via package
    "Wx::DateTime" at ... line ..."
    (Same for ParseTime).
    ParseTime and ParseFormat are wxWidgets DateTime methods.
    Am I missing something, or calling with a wrong syntax?
    Where can you find all implemented methods for wxPerl Wx::DateTime?
    Many TIA
    Helen
    NB My system: Windows 7, Citrus Perl 5.16.3, wxWidgets 2.9.4


Reply via email to