Search DominoPower's 11,443 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Build a Domino pop-up calendar widget using formula language (continued)

The value of the DateVal field is used to give a string name to the month to which the year is appended.

Building the calendar
After the table row containing the five computed text fields, you should create a row with seven columns, each bearing a two letter heading for a day of the week. Start with Sunday, as this is Domino's preferred start day and after you reach the end, close the table row and open a new one.

Next, insert a computed rich-text field named "calendar". This is the heart of the calendar generation system. The formula should be as follows:

REM {Domino Popup Calendar Widget -- Daniel Koffler 2004}
1 tDate := @Date(DateVal);

REM {-*-*- Get Starting Parameters -*-*-}
2 FirstOMonth := @Adjust(tDate; 0; 0; -(@Day(tDate) - 1); 0; 0; 0);
3 tDayNum := @Weekday(FirstOMonth);
4 tMonth := @Month(FirstOMonth);

REM {-*-*- Cycle through all slots in table -*-*-}
5 tmpDates:="";
6 @For(n :=1; n<=42; n:= n + 1;
7 nDate:= @Adjust(FirstOMonth; 0; 0; (n - tDayNum); 0; 0; 0);
8 tDayTxt := @Right("0" + @Text(@Day(nDate)); 2);
9 tLink:={<a href="#" onClick="opener.document.forms[0].}+upField+{.value = '} +@Text(nDate;"D0")+ {';window.close()">}+tDayTxt+"</a></td>";
10 dspDate := @If(@Month(nDate) != tMonth; {<td class="otherMonth" ></td> }
@If(nDate = @Today;{<td class="today">} +tLink;{<td class="thisMonth">}+tLink));
11 dspDate:=@If(@Modulo(n;7) =0; dspDate+"</tr><tr>";dspDate);
12 tmpDates:=tmpDates : dspDate
);

REM {-*-*- Print Results. -*-*-}
13 @Implode(tmpDates)

Line 1 gets the value from the DateVal field and makes sure it is a Domino time object. Line 2 gets the first day of the month as a time object by adjusting the DateVal date back to one day less than the day of the month in DateVal. This will always give you the first day of the month specified in DateVal.

Line 3 uses the @Weekday function to get a number between 1 and 7 corresponding to the day of the week of the first day of the month (1=Sunday, 7=Saturday). Line 6 initiates a loop through the maximum 42 that might make up our calendar. That's seven columns multiplied by six rows.

Line 7 sets nDate to the next date we want to work on when going through the @For loop. For our table to line up properly, all the day numbers must be 2 digits. Line 8 gates the day of the month, converts it to a text value and ensures it is a 2-character sequence such as 02 instead of 2.

Line 9 creates an HTML link with a JavaScript onClick event. When clicked, this link uses JavaScript to update the a field on the calling form using the "opener" object and we know what field to update based on the value of upField. After the field on the opener form is updated we use a JavaScript call to close the popup window.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  Next »
Other articles you might like
Home > Lotus Technologies > Domino (77 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   Sloppy analysis at the core of another Domino vs. SharePoint report
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Syncing Notes with Android phones
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes.

Try IntelliPRINT NOW!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login