![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: DXL Calendar Topic Summary: Created On: 11-Nov-2002 15:08 Status: Post and Reply |
Linear : Threading : Single : Branch |
|
![]() |
![]()
|
![]() Answer: Antonio's version above goes back to being a day out (it says today is Friday 10th, should be Thursday) | |||||||||
![]() |
|||||||||
Has anyone written a script to bring up a calendar from which a date can be selected for insertion into an attribute?
I am looking for something that will start with the current month and allow me to select future months if I need to. The background to this is a simple To Do list with a due date. Hazel ------------------------- Hazel Woodcock |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi Hazel,
I have programmed an DBE, which You can use for Your Dialog. The test_calendar.dxl file shows, how it can be used ... Greetings Reik Schröder Siemens AG Berlin ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi, Reik.
Very nice script ;-) But we should initialise the skip list 'vars' (line 220 of calendars.inc) and comment out the first include (dates.inc) before running (for DOORS 5.2/7.1), otherwise there will be the error 'ambiguous identifier (null)' in line 221. dirk plaschke. (Siemens AG, Bln-E) ------------------------- Dirk Plaschke |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Can you post the correction? Much appreciated, as I would like to see what this script does.
Thanks ------------------------- Pieter de Waard www.nhindustries.com |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Sorry for error messages - was copy and paste problem ;-))
Here are the right code versions .... Reik Schröder Siemens AG Berlin (Bln-S50)
------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany Edited: 6-Sep-2006 at 09:11 by Reik Schroeder |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
I had a problem with the calendar. some of the dates are insensitive, and therfore cannot be chosen. usually those in the end of the month. did anyone succeeded in fixing that?
Thanks, Asaf Kivity ManageWare |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Some fixes in the following version of calender.inc
- Changed abbreviation of Wednesday to "Wed" - Added extra row of days, since days were being missed out for months starting on Saturday or Sunday - Fixed bug where call to calendarGetDaysInMonth was passing in an incorrect month value |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
I fixed some bugs in this a while ago. I haven't looked to see if we fixed the same ones!
------------------------- Tony Goodman http://www.smartdxl.com |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Tony,
your version is based on a version taken before Reik did some bug-fixing. Cheers, Antonio. Edited: 3-Mar-2005 at 10:03 by Antonio Norkus |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
What a clever script! One small problem though: It tells me that today is Friday 3rd March (should be Thursday).
|
|||||||||
![]() |
|||||||||
![]() |
|||||||||
I agree -- clever script! I was able to fix the day problem by modifying the constant:
Original: const string calendar_days__[] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"} Fix: const string calendar_days__[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"} I also modified the code so that the Sunday column would also be in red: Original Lines (appears in 2 places in the code): if (x>5) realColor (canv, realColor_Red) else realColor (canv, realColor_Black) New Lines: if ((x>5) || (x==0)) { realColor (canv, realColor_Red) } else { realColor (canv, realColor_Black) } ------------------------- Karen Hidalgo<BR>Northrop Grumman - TASC<BR>karen.hidalgo@ngc.com Edited: 3-Mar-2005 at 16:52 by Karen Hidalgo |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
I don't see a problem with the start day...out of curiousity Paul and Karen, are you in the US? It may be that the depending on the locality of the OS, "today" returns different values.
What value do you get printed from the following DXL? print dateOf(1) "" I get "01/01/70 01:00:01" which looks as though it's an hour out...surely it should be "01/01/70 00:00:01"! |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Yes, I am in the US. The value I get when I print
print dateOf(1)"" is 12/31/69 19:00:01 ------------------------- Karen Hidalgo<BR>Northrop Grumman - TASC<BR>karen.hidalgo@ngc.com |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Karen,
I just ran into this myself. I was attempting to write a function to return a date/time that repesents the midnight that begins the current day. The following should have worked: int todayInt = intOf( today ) Date midnightBeforeNow = dateOf( todayInt - ( todayInt % ( 60*60*24 ) ) ) print midnightBeforeNow "\n" It returns a result of five hours behind, which is how many hours I am behind Greenwich Mean Time (GMT). I compensated for that, as below, but that only gives the correct answer if run it from a compter set for Eastern Time (EST). int todayInt = intOf( today ) Date midnightBeforeNow = dateOf( todayInt - ( todayInt % ( 60*60*24 ) ) + 60*60*5 ) print midnightBeforeNow "\n" I believe the dateOf() function is compensating for GMT, perhaps when it should not. ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
OK...here's a version that adjusts for GMT.
Karen...this version colours Saturday and Sunday red. Michael...you may want to use the function in there that gets the current GMT adjustment, rather than hard coding it. Edited: 4-Mar-2005 at 11:58 by Antonio Norkus |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Hi,
My group had ran into the same problem some time back and used the following simple fix to the dayOfWeek function. Note the +4 in the function instead of +3. Edited: 7-Mar-2005 at 06:01 by Chun Ho |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
OK...If someone new to the forum were to want the calendar functionality...what the hell would they download from this thread? There are multiple copies of calendar.inc and numerous bug fix extracts.
Here is a version of calendar.inc, with the bugs mentioned in this thread fixed and described. If you find a bug in this version and have a fix, please update this version and add a comment as to what has been fixed, so that the DXL community can benefit from the bug-fix and also know which version they have got. Edited: 7-Mar-2005 at 12:03 by Antonio Norkus |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Antonio's version above goes back to being a day out (it says today is Friday 10th, should be Thursday)
|
|||||||||
![]() |
|||||||||
![]() |
|||||||||
I fixed the reintroduced problem of the day offset, and noticed that May 2005 and later was incorrect (I'm in the US). I scrapped the whole notion of the GMT adjustment and used some VB code as a basis for restructuring the dayOfWeek function so that it works based upon the normal differences between the first days of the month, including allowing for leap year. Since this is not reliant on the dateOf(1) function, hopefully this will be correct for the entire world.
------------------------- Jeremy Eble Software Engineer Teragon Consulting LLC jeremy.r.eble@lmco.com |
|||||||||
![]() |
|||||||||
![]() |
|||||||||
Jeremy,
Can you please explain what this line does in the dayOfWeek routine?
const int MONTHDAYS[] = {5, 1, 1, 4, 6, 2, 4, 0, 3, 5, 1, 3} //separation of first days by month
Sorry, I'm new to the DXL development and tried to understand you code.
Thanks!
|
|||||||||
![]() |
|||||||||
Telelogic DOORS
» DXL Exchange
»
DXL Calendar
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.