Unfortunately, To-Do's are still not rolling over. Actually, now I am not sure whether my previous modification worked or not. It certainly is not working now.
Here's my situation:
Currently, all To-Do's are displayed on their Start Date (creation date), until they are marked done. I don't want that.
I want To-Do's to "roll over" = to show up on today's date until they are marked done. When they are marked done, I want them to show up on the date they were marked done. But I also want the To-Do's creation date to display as the "Start Date".
So for example, I create a To-Do today. Its start date is 2/2/2015. It is not done. Therefore, it should appear on the current date in calendar views. So let's say it's now 3 days from now (2/5/2015). I complete the To-Do. I mark it Done. Now it should remain visible on 2/5/2015 for ever. And: when I click to open this To-Do (to view its details), I should see: Start Date: 2/2/2015; Done Date: 2/5/2015.
I hope it's clear from the above description that I do not need or want any "due dates."
So, here's what I have in my current file, which is a previous version of SeedCode calendar that is linked to the current version of DayBack:
DBK_TimeStampEndCalcNum:
- Code: Select all
Let ( [
//============= Assign your date and time fields here ==========================
ds = DateStart ; // Your event's date start field
de = DateDone ; // Your event's date end field
ts = TimeStart ; // Your event's time start field
te = TimeEnd ; // Your event's time end field
//============= We treat ToDos a little differently also aslo ask for their done date and status ==
dd = DateDone ; // Your event's done date field
sts = Status ; // Your event's status field
//============= You shouldn't have to edit below this line ==========================
spanmidnight = not IsEmpty ( te ) and te < ts ;
de = If ( sts= "done" ; dd ; Get ( CurrentDate )) // for To-Dos we show the event on its start date if not done, if done the on its done date
] ;
GetAsNumber (
Timestamp (
If ( spanmidnight and IsEmpty ( de ) ; ds + 1 ; Max ( ds ; de ) )
;
If ( IsEmpty ( te ) ; Max ( ts ; 0 ) ; te )
)
)
)
DBKTimeStampStartCalcNum:
- Code: Select all
Let ( [
//============= Assign your date and time fields here ==========================
ds = DateStart ; // Your event's start date field
ts = TimeStart ; // Your event's start time field
//============= We treat ToDos a little differently also aslo ask for their done date and status ==
dd = DateDone ; // Your event's done date field
sts = Status // Your event's status field
//============= You shouldn't have to edit below this line ==========================
];
GetAsNumber (
Timestamp ( If ( sts = "done" ; dd ; Get ( CurrentDate )) ; Max ( ts ; 0 ) ) // show the event on it's done date if done, otherwise on it's start date.
)
)
DBK_WebViewerSource:
- Code: Select all
Let ( [
//============= Assign your event fields here ==========================
sourceNumber = 2 ; // The source number as defined in the "Source No" layout
id = id ; // the unique ID or primary key of your event record. Often, it's serial number.
startDate = Case (IsEmpty (DateDone) ; Get ( CurrentDate ) ; DateDone) ;
startTime = TimeStart ;
endDate = Case (IsEmpty (DateDone) ; Get ( CurrentDate ) ; DateDone) ;
endTime = TimeEnd ;
summary = Summary ;
summaryCalc = DBK_EventSummaryCalc ; //Read only
description = Description ;
resource = Resource ;
status = Status ;
contactID = "" ;
contactName = "" ;
projectID = "" ;
projectName = "" ;
// ===== Define options here ->
returnSeparator = " | "; //This is the character that will be shown in place of return characters when viewing certain views.
//============= Do not edit below this line ==========================
summaryCalc = DBK_EventSummaryCalc ; // Should always be DBk_EventSummaryCalc
allDay = Case ( startTime > 0 ; "false" ; "true" ) ;
startDate = Max ( Date ( 0 ; 0 ; 0 ) ; startDate ) ;
startTime = Max ( Time ( 0 ; 0 ; 0 ) ; startTime ) ;
s_yr = Right ( "0000" & Year ( startDate ) ; 4 ) ;
s_mo = Right ( "00" & Month ( startDate ) ; 2 ) ;
s_da = Right ( "00" & Day ( startDate ) ; 2 ) ;
s_hr = Right ( "00" & Hour ( startTime ) ; 2 ) ;
s_mi = Right ( "00" & Minute ( startTime ) ; 2 ) ;
s_se = Right ( "00" & Seconds ( startTime ) ; 2 ) ;
iCalStart = s_yr & "-" & s_mo & "-" & s_da & "T" & s_hr & ":" & s_mi & ":" & s_se ;
endDate = Case (
IsEmpty (endDate) ; "" ;
Max ( Time ( 0 ; 0 ; 0 ) ; endDate )
) ;
endTime = Case (
IsEmpty (endTime) ; "" ;
Max ( Time ( 0 ; 0 ; 0 ) ; endTime )
) ;
e_yr = Right ( "0000" & Year ( endDate ) ; 4 ) ;
e_mo = Right ( "00" & Month ( endDate ) ; 2 ) ;
e_da = Right ( "00" & Day ( endDate ) ; 2 ) ;
e_hr = Right ( "00" & Hour ( endTime ) ; 2 ) ;
e_mi = Right ( "00" & Minute ( endTime ) ; 2 ) ;
e_se = Right ( "00" & Seconds ( endTime ) ; 2 ) ;
iCalDateEnd = Case (not IsEmpty (endDate) ;
e_yr & "-" & e_mo & "-" & e_da ;
"" );
iCalTimeEnd = Case (not IsEmpty (endTime) ;
"T" & e_hr & ":" & e_mi & ":" & e_se ;
"" );
iCalEnd = iCalDateEnd & iCalTimeEnd ;
substituteReturn = Case ($$sc_Mode = "Month" or $$sc_Mode = "Day" or $$sc_Mode="Week" or allDay = "true" ;
returnSeparator ;
"\n"
)
] ;
Substitute (
List (
Quote ( Substitute ( sourceNumber ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( id ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( allDay ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( iCalStart ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( iCalEnd ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( summaryCalc ; ["¶" ; "\n"] ; ["\n" ; substituteReturn] ) ) ;
Quote ( Substitute ( Summary ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( Description ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( Resource ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( Status ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( contactID ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( contactName ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( projectID ; "¶" ; "\n" ) ) ;
Quote ( Substitute ( projectName ; "¶" ; "\n" ) )
)
; "¶" ; "," )
) // End Let
So can you help me fix this?
Jim