Create a Formatted Date String

This routine illustrates how to create a formatted date string that includes the day of the week, month, day, and year (e.g., Friday April 14, 2006).

How It Works

The formatted date is computed with a combination of the @Today, @Weekday, @Year, @Month, and @Day functions. The returned values are subsequently used to create the formatted date string, which is stored in the theDate variable.

Implementation

To implement this solution, insert the following formula in an action button, column, or default value for a field. Optionally, replace @Today with a date or field. The @Prompt statement is used for illustrative purposes and can be removed or updated as desired. However, if removed, be sure the formula contains a main expression (i.e., Result) as the last statement in the formula.

theDate := @Today;

theWeekday := @Select(@Weekday (theDate);
 "Sunday"; "Monday";
 "Tuesday"; "Wednesday";
 "Thursday"; "Friday";
 "Saturday"
 );

theMonth := @Select(@Month(theDate);
 "January"; "February"; "March";
 "April"; "May"; "June";
 "July"; "August"; "September";
 "October"; "November"; "December"
 );

theDay := @Text (@Day (@Today));

theYear := @Text (@Year (theDate));

result := "Today is " +
theWeekday + " " +
theMonth + " " +
theDay + ", " +
theYear;

@Prompt([Ok];"Result"; result);

Figure 14.5 depicts the result when implemented in an action button.

Figure 14.5. Example of a formatted date string


An Introduction to the Lotus Domino Tool Suite

Getting Started with Designer

Navigating the Domino Designer Workspace

Domino Design Elements

An Introduction to Formula Language

An Introduction to LotusScript

Fundamentals of a Notes Application

Calendar Applications

Collaborative Applications

Reference Library Applications

Workflow Applications

Web Applications

Design Enhancements Using LotusScript

Design Enhancements Using Formula Language

View Enhancements

Sample Agents

Miscellaneous Enhancements and Tips for Domino Databases

Data Management

Security

Application Deployment and Maintenance

Troubleshooting

Appendix A. Online Project Files and Sample Applications

Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?



Lotus Notes Developer's Toolbox(c) Tips for Rapid and Successful Deployment
Lotus Notes Developers Toolbox: Tips for Rapid and Successful Deployment
ISBN: 0132214482
EAN: 2147483647
Year: N/A
Pages: 293
Authors: Mark Elliott

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net