I have a calendar view that is supposed to show multiple days where users sign out of the office. I have 2 calendar control date/time fields in the form to indicate the out and return date. when a user signs out for mutliple days, the calendar view only shows the first day they are out (the sign out date). It does not show an entry in the return date, nor the days in between. Can someone please help?
Subject: RE: Calendar View Problem
The first column of the view is hidden, and contains the date/time where the entry should be displayed. This column can contain a multi-value expression to make the entry appear on multiple days. Use @Explode. If you want to remove the weekend days from the result, search the Notes 4/5 forum for @Explode and @weekday and you’ll find examples of this.
Rather than do this calculation in a view column formula, you might want to have a hidden computed field on the form. It’s faster.
Subject: RE: Calendar View Problem
the computed field would be the way to go. Then I can simply place that field as the column value? I looked for examples in the 4/5 forum, but to no avail. Might anyone happen to have an example? Calendaring is very new to me. i appreciate any and all input.
Subject: RE: Calendar View Problem
The standard formula for DatesCompute is
@Explode(@TextToTime(“[” + @Text(@Date(StartDate)) + “-” + @Text(@Date(EndDate)) + “]”))
@Explode will create a date-time list from a date range. The problem is that a date range has this general form:
[04/21/2003-04/25/2003]
That’s easy to enter as a literal value, but not so easy to do as “bunch of parts”. Normally, it is the worst of all things to convert dates to text and back because of the effects of user and server settings. In this case, the whole thing is being done in one line of code on one machine, and it’s highly doubtful that any user can type fast enough to change their date-time preferences between the time they click “Save” and the time the formula finishes running.
Subject: RE: Calendar View Problem
Actually, make that:
@Explode(@TextToTime(@Text(@Date(StartDate)) + " - " + @Text(@Date(EndDate))))