invalid date and/or time error when I try to add an event

Need help with VueMinder Pro or Ultimate? Ask your questions here.
User avatar
still life
Posts: 7
Joined: Sat Dec 12, 2009 1:22 pm
Location: Belluno - Italy
Contact:

Re: invalid date and/or time error when I try to add an event

Post by still life » Wed Dec 16, 2009 6:42 am

unfortunately the error still the same but the sequences of times in the message now is

0 0 1 0 0 1
instead of
8 8 9 8 8 9

User avatar
still life
Posts: 7
Joined: Sat Dec 12, 2009 1:22 pm
Location: Belluno - Italy
Contact:

Re: invalid date and/or time error when I try to add an event

Post by still life » Tue Jan 05, 2010 7:58 am

any idea?

User avatar
VueSoft
Dan Chartrand
Posts: 3851
Joined: Sat Aug 23, 2008 12:39 am
Location: St. Louis, Missouri, USA
Contact:

Re: invalid date and/or time error when I try to add an event

Post by VueSoft » Tue Jan 05, 2010 6:01 pm

Unfortunately, I've run out of ideas on how to fix the problem you're seeing. The code should be working as written. Every variation I've tried basically has the same behavior. It's almost as if your installation of Microsoft .NET Framework 2.0 is messed up, or maybe there's a bug in the .NET Framework. The code that I wrote to parse the time is really only a couple lines, commanding a common function that Microsoft provides in the .NET Framework, and written so that it should work the same regardless of regional differences in the date and time formats.

It's really odd that it parses dates/times fine on most computers, but not on yours. I'm sorry, but I don't know what else to try. :?
Dan Chartrand, Founder
VueSoft LLC | St. Louis, Missouri, USA

User avatar
still life
Posts: 7
Joined: Sat Dec 12, 2009 1:22 pm
Location: Belluno - Italy
Contact:

Re: invalid date and/or time error when I try to add an event

Post by still life » Wed Jan 06, 2010 9:57 am

I have just installed windows 7 x64 in italian and now the program works fine.

I don't know if is an important information but in the previous configuration of my SO I have used win 7 x86 in italian but with the english language. Can it create date format problems, maybe?

So, thank for the support and good work.

User avatar
VueSoft
Dan Chartrand
Posts: 3851
Joined: Sat Aug 23, 2008 12:39 am
Location: St. Louis, Missouri, USA
Contact:

Re: invalid date and/or time error when I try to add an event

Post by VueSoft » Wed Jan 06, 2010 10:32 am

Well, that's a relief! I really don't like giving up on a problem, but this was one I just couldn't figure out. I'm glad to hear it's working now. :D

It's possible the previous configuration you were using was somehow related to the formatting issues. The odd thing though, is the message box I added for debugging was showing an expected format that matched the input format that was failing to parse. I also tried configuring my test computer the same way I believe yours was configured, but never could repeat the error.
Dan Chartrand, Founder
VueSoft LLC | St. Louis, Missouri, USA

eclipse79
Posts: 10
Joined: Wed Oct 13, 2010 4:33 am

Re: invalid date and/or time error when I try to add an even

Post by eclipse79 » Wed Oct 13, 2010 4:38 am

Hello,
I have exactly the same issue. I'm using the latest verison (7.4.2) in a Windows 7 with Italian language and date/time settings. No issue in XP pro (with the same language).

Someone has got a solution?

User avatar
VueSoft
Dan Chartrand
Posts: 3851
Joined: Sat Aug 23, 2008 12:39 am
Location: St. Louis, Missouri, USA
Contact:

Re: invalid date and/or time error when I try to add an even

Post by VueSoft » Wed Oct 13, 2010 9:39 pm

Sorry, I was unable to determine what is causing this. It appears to only happen in Italy and has something to do with Windows or the Microsoft .NET Framework. It's also inconsistent between computers. I thought maybe it was something Microsoft fixed in Windows 7, but it doesn't look that way.
:?
Dan Chartrand, Founder
VueSoft LLC | St. Louis, Missouri, USA

eclipse79
Posts: 10
Joined: Wed Oct 13, 2010 4:33 am

Re: invalid date and/or time error when I try to add an even

Post by eclipse79 » Mon Oct 18, 2010 4:59 am

VueSoft wrote:Sorry, I was unable to determine what is causing this. It appears to only happen in Italy and has something to do with Windows or the Microsoft .NET Framework. It's also inconsistent between computers. I thought maybe it was something Microsoft fixed in Windows 7, but it doesn't look that way.
:?
So, there is no solution? If you want I can help you in finding a solution, I am a developer


bye
eclipse79

User avatar
VueSoft
Dan Chartrand
Posts: 3851
Joined: Sat Aug 23, 2008 12:39 am
Location: St. Louis, Missouri, USA
Contact:

Re: invalid date and/or time error when I try to add an even

Post by VueSoft » Mon Oct 18, 2010 5:25 pm

Well, there's no solution yet, but I've thought of a few more things to try.

The code is pretty simple. I'm just using the .NET functions provided by Microsoft for parsing the date and time. Based on Microsoft's documentation, it's supposed to always work, for all Windows cultures. For some reason it doesn't. Here's the code (C#). Maybe you can see something here I've missed:

Code: Select all

                     
DateTime date = DateTime.Today;
DateTime time = DateTime.Now;

if (DateTime.TryParse(ultraCalendarComboStartDate.Text, out date))
{
   if (!ultraCheckEditorAllDay.Checked)
   {
      if (DateTime.TryParse(
         DateTime.Today.ToShortDateString() + " " + ultraComboEditorStartTime.Text,
         CultureInfo.CurrentCulture,
         DateTimeStyles.AllowWhiteSpaces, 
         out time))
      {
         dateTime = date + time.TimeOfDay;
         valid = true;
      }
      else
      {
         if (showError)
         {
            MessageBox.Show(
               "An error occurred parsing the specified time. The time string was " +
               ultraComboEditorStartTime.Text + ".\n\nA valid format would be " +
               DateTime.Now.ToShortTimeString(),
               "Error Parsing Start Time");
         }
      }
   }
   else
   {
      dateTime = date;
      valid = true;
   }
}
else
{
   if (showError)
   {
      MessageBox.Show(
         "An error occurred parsing the specified date. The date string is " +
         ultraCalendarComboStartDate.Text + ".\n\nA valid format would be " +
         DateTime.Today.ToShortDateString(),
         "Error Parsing Start Date");
   }
}
Dan Chartrand, Founder
VueSoft LLC | St. Louis, Missouri, USA

eclipse79
Posts: 10
Joined: Wed Oct 13, 2010 4:33 am

Re: invalid date and/or time error when I try to add an even

Post by eclipse79 » Tue Oct 19, 2010 4:20 am

Hi Dan,
I'll try to compile a simple project with your code and run it in the client... I'll inform you about the test as soon as possible.

Thank you
Fabio

Post Reply