Print Page | Close Window

Bug with date format parsing in StripFormat()

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=17364
Printed Date: 18 April 2024 at 8:18pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug with date format parsing in StripFormat()
Posted By: ES
Subject: Bug with date format parsing in StripFormat()
Date Posted: 02 October 2010 at 6:45am
Hi,
I've discovered a bug in CXTPCalendarUtils::StripFormat() when running the sample Calendar demo and having a Windows date format containing a text string before the datum, i.e. 'today is 2/10-2010'. Maybe only a local issue as the default Windows date format varies, but nevertheless a bug...(as my localized version of Windows use this type of date format as default).

What happens is nIndex becomes -1 before checking IsFormatChar(strFormat[nIndex]), which causes an exception. A simple problem to correct, but I guess it should be done by Codejock in an upcoming release to propagate the fix to all users.
I've attached the code snippet below, the first while block finds a '-character in the first position (0) and then subtracts (with nIndex--) twice before ending the loop. Then nIndex++ adds one, but nIndex is still negative when entering the last while block;



/ES




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net