problem formatting dates from text fields.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • krishnakant Mane

    problem formatting dates from text fields.

    hello all.
    thanks for the help and for pointing me to the proper url for wxpython
    related issues.
    I am so happy that I now have a very easy gui library that can do
    practically every thing with such ease (no flames intended but I was
    never at so much ease with java swing ).
    I however have a problem with dates.
    I am tired searching for some good tutorial that can explain the basic
    functionality of wx.datetime class and the datetime picker.
    I want to display the date in dd/mm/yyyy format and allow the user to
    change the dates.
    I then will like to take the value (the entire date) and put into a database.
    now this is my first question.
    the other problem is even more tough to solve with my given knowledge
    of wx.datetime and related classes.
    unfortunately the database given to me has a text field for date and
    the data is neetly entered.
    but when I get the data back from that text field I some how want to
    convert it back to actual date in the same dd/mm/yyyy format and send
    this as a value to my date time picker.
    how can I achieve this?
    thanking all.
    Krishnakant.
  • John Machin

    #2
    Re: problem formatting dates from text fields.


    Dennis Lee Bieber wrote:
    On Mon, 4 Dec 2006 01:11:30 +0530, "krishnakan t Mane"
    <researchbase@g mail.comdeclaim ed the following in comp.lang.pytho n:
    >
    I am tired searching for some good tutorial that can explain the basic
    functionality of wx.datetime class and the datetime picker.
    I want to display the date in dd/mm/yyyy format and allow the user to
    change the dates.
    >
    Simplest is probably to do what many web-sites use for credit card
    expiration dates... Ignore any pre-built date-time modules...
    >
    Create three integer fields, make the first two drop-down lists
    pre-populated with days and months. And validate the results later (just
    to cover someone putting in 31 02 xxxx).
    >
    My 2 cents worth:

    (1) this annoys the bejaysus out of data inputters who can type
    "31\t12" a lot faster than they can pick it out of two drop-down lists.

    (2) this would annoy the bejaysus out of data users if they were aware
    of the extent of off-by-one errors caused by using drop-down lists.

    Cheers,
    John

    Comment

    • krishnakant Mane

      #3
      Re: problem formatting dates from text fields.

      On 04/12/06, Dennis Lee Bieber <wlfraed@ix.net com.comwrote:
      You don't show us what format is used in the database, so there is
      nothing to base a conversion on. Is it year/month/day, month/day/year;
      months numeric or alpha (abbreviated or spelled out). Fields separated
      by space, comma, -, :, or /
      >
      the format in the text field is dd/mm/yyyy which is perfect for what I need.
      but the problem as I said is to get this text into a value that can
      fit into a date time picker.
      can this be done?
      Krishnakant.

      Comment

      • krishnakant Mane

        #4
        Re: problem formatting dates from text fields.

        is there a soft copy of wxpython in action available for free download?
        I saw the book on my book store but since I am totally blind, I have
        to depend on soft copies.
        Krishnakant.

        Comment

        • Robert Kern

          #5
          Re: problem formatting dates from text fields.

          krishnakant Mane wrote:
          is there a soft copy of wxpython in action available for free download?
          I saw the book on my book store but since I am totally blind, I have
          to depend on soft copies.
          It is not available for free, no. However, it is available in PDF form from
          Manning's website:

          wxPython in Action is a complete guide to the wxPython toolkit, containing a tutorial for getting started, a guide to best practices, and a reference to wxPython's extensive widget set. After an easy introduction to wxPython concepts and programming practices, the book takes an in-depth tour of when and how to use the bountiful collection of widgets offered by wxPython. All features are illustrated with useful code examples and reference tables are included for handy lookup of an object's properties, methods, and events. The book enables developers to learn wxPython quickly and remains a valuable resource for future work.


          If their Yahoo store is not accessible via your web reader (I have no
          experience, so I won't depend on it), you can email the publisher's customer
          service at support@manning .com and I'm sure they will get the book to you in a
          form you can read.

          --
          Robert Kern

          "I have come to believe that the whole world is an enigma, a harmless enigma
          that is made terrible by our own mad attempt to interpret it as though it had
          an underlying truth."
          -- Umberto Eco

          Comment

          • Hendrik van Rooyen

            #6
            Re: problem formatting dates from text fields.

            "John Machin" <sjmachin@lexic on.netwrote:
            Dennis Lee Bieber wrote:
            8<--------------------------------------------------
            Simplest is probably to do what many web-sites use for credit card
            expiration dates... Ignore any pre-built date-time modules...

            Create three integer fields, make the first two drop-down lists
            pre-populated with days and months. And validate the results later (just
            to cover someone putting in 31 02 xxxx).
            >
            My 2 cents worth:
            >
            (1) this annoys the bejaysus out of data inputters who can type
            "31\t12" a lot faster than they can pick it out of two drop-down lists.
            >
            (2) this would annoy the bejaysus out of data users if they were aware
            of the extent of off-by-one errors caused by using drop-down lists.
            >
            Cheers,
            John
            This annoyance can be maximised if, after the selection, a pop up dialog window
            is displayed showing what was chosen, along with the following text:

            "This is what you have chosen - Please indicate whether or not you wish to re
            try"

            - with the focus on the "yes" button.
            and then, when "yes" is chosen, to start again without any attempt to remember
            the previously entered values

            - Hendrik


            Comment

            Working...