Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: How to check if a date is valid
Topic Summary:
Created On: 4-Apr-2006 16:30
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 4-Apr-2006 16:30
User is offline View Users Profile Print this message


Dawn Voss

Posts: 8
Joined: 6-Mar-2006

How can you check to see if a user's input of a date is valid?  Is there a dxl function to verify validity of dates?
Thanks for your help,
~Dawn

Report this to a Moderator Report this to a Moderator
 4-Apr-2006 18:24
User is offline View Users Profile Print this message


Shawn Stepper

Posts: 96
Joined: 6-Aug-2004

Try this.

-------------------------
Shawn Stepper
shawn.e.stepper@wellsfargo.com
Report this to a Moderator Report this to a Moderator
 4-Apr-2006 19:30
User is offline View Users Profile Print this message


Dawn Voss

Posts: 8
Joined: 6-Mar-2006

Thanks for the code,

   I've tried your way, but the user wants a flexable GUI that will take all of the DOORS valid dates, so I tried using the following:

bool DateIsValid(string s)

{

Date d

bool b_result

noError

d = s

err = lastError

if (!null err && !null s) then return false

else return true

}

The problem is that it allows the user to enter 3/33333/06 and says that it is valid.  Does anyone know the solution to this?
Thanks for your help,
~Dawn

Report this to a Moderator Report this to a Moderator
 5-Apr-2006 12:45
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

I have reported this as a bug to DOORS support.

There is a bug in the way date strings are validated.

I can assign a date as follows:

Date d = "3/32/2006"

which gets converted to "1 April 2006".

or

Date d = "3/11648/2006"

which gets converted to "19 January 2038".

This date is the maximum that it will accept.

This error only seems to occur when entering dates in US format as above. Using european format (DD/MM/YYYY) is okay.

The same behaviour is exhibited when entering date strings into an attribute using the GUI.

I am using DOORS 7.1 patch 011 on Windows 2000 professional.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 5-Apr-2006 13:36
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

I just checked and this bug seems to be fixed in DOORS 8.0.
I am in the UK. Maybe someone in the states can confirm that this is fixed there too.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 5-Apr-2006 19:57
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Using US format dates is pretty rediculous since while DOORS can tell that "3/21/06" means "March 21 2006" it thinks that "3/7/06" is in European format, "3 July 2006" instead of the intended "March 7 2006". Since its limited, DOORS should not recognize these dates at all.

All my DXL outputs thusly: "2006-Mar-07" primarily when used in file names it sorts pretty well. I cannot bring myself to this format: "2006-03-07" since I personally cannot count months to 12, unless I've got a shoe off.

- Louie

I was also arrested once counting to 21 in a black-jack game. lol
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.