in reply to Re^4: Win32::GUI::Grid & Date Formats
in thread Win32::GUI::Grid & Date Formats

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^6: Win32::GUI::Grid & Date Formats
by diakonos (Hermit) on Jul 21, 2005 at 13:06 UTC
    Calm Down... Geez.. ChrisR has been on this board since 2001 and you have only been on here one month and you are telling him what this board is for? C'mon!

    Look at his first reply above in the post. He is using a grid control in a GUI and attempting to format the control with data to correctly set the calendar date. He is probably linking this to some type of database thas has a different format of the date string than does the calendar control. If this is the case, it would be a problem and the string input would need to be changed in the module of the calendar control. I think this may be where he is coming from.

    I have ran your code that you posted and it still does not work. If you really want to help this guy read his post and his code.

    Regards..

Re^6: Win32::GUI::Grid & Date Formats
by ChrisR (Hermit) on Jul 21, 2005 at 14:48 UTC
    From the above post before you changed it:

    There was a cut&paste error which I fixed now.
    Still doesn't work

    BUT watch out, your test example is in M-d-yyyy format instead of d-M-yyyy.
    Watch out for what? The default short date format in the US (my location) is M-d-yyyy. There are many date formats specific to different regions in the world however, from my experience, a universally accepted format is yyyy-M-dd. I have yet to find an example of yyyy-d-M which is what your code now turns the date into.

    It's a good idea if you try to make the necessary change yourself, if that's the format you want to be the input.
    My data is already in the format I need however the date format of the control is not (I need to set the format of the control). Re-formatting the string itself is easy

    my $datein = "7-19-2005"; my ($month,$day,$year) = $datein =~ /(\d+)-(\d+)-(\d+)/; my $dateout = "$year-$month-$day"; $dateout =~ s/-(\d)-/-0$1-/; print "$dateout\n";
    But that is not what I need to do.

    The purpose of perl monks is to offer guidance, rather than program for people.
    Dude! That just kind of hit me the wrong way. I know that what you say is true but did I ask for someone to write this program for me? No. Did I post code that reproduces the problem? Yes. I am just looking for a way to acces the DateTime object in the Grid Cell object so that I can use the methods of the DateTime object. As far as I can tell, this is not documented or I just can't find the documentation for it. I even looked into the code in Grid.pm but I'll be the first to admit that some of that stuff is currently above my level of perl. I only asked for a hint and PerlMonks has a great reputation for being able to solve seemingly unsolvable problems.

    But since you changed your post intead of just updating it, let me address the new post

    But I coded it for d-M-yyyy instead of M-d-YYYY
    Why? Did I specify d-MM-yyyy? I thought I specified M-d-yyyy as the beginning format.

    I've been working on too many new anonymous monk posts recently and hadn't turned off the 'autopilot'.
    In my opinion, if you are working on this site in "autopilot" mode, you shouldn't offer anything at all. And are "anonymous monk posts" less deserving than others? I don't think so. There have been many good discussions here that talk about what perlmonks is for and the right way to respond to questions. Perhaps you should read some of them. I know that my response here could be considered in bad taste and not the perlmonks way but I just had to speak my mind.

    Chris

    A reply falls below the community's threshold of quality. You may see it by logging in.