/ Forums / Advansys Formativ / Creating Solutions with Formativ / How to open calendar on a specific date / Reply To: How to open calendar on a specific date

Support 1

I think you are referring to a GroupWise Token API method for obtaining a message date, like:

  dim iDateStr
  iDateStr = GroupWise.ItemGetDate(...)

This method returns a string representation of the date. The Token API also has methods for parsing a date string eg. GroupWise.DateParseDay(), but I notice the online documentation is vague on how to get ItemGetDate() and DateParseDay() to agree on a date format.

We have only a little experience with handling these string-typed GroupWise dates. In fact, we strongly recommend that applet writers avoid processing string dates, due to the date format problem you have discovered.

It is simpler by far to work with a Date variable in your Formativ scripting, and to extract date components as necessary using VBScript functions like Day(), Month(), Year(). This is why the example applet in my earlier post uses the Formativ object model (Client.ClientState) to obtain a reference to the relevant message.

Note: if you have already obtained a message ID string using the Token API, you can obtain an object reference to the message as follows:

  dim iMessageID
  dim oMessage
  ' Initialize iMessageID
  ' ...
  set oMessage = GroupWise.Account.GetMessage(MessageID)

Note: you can find more information about the ClientState object in the Applet Structure section of the Formativ Programmers Guide.

Once again, thank you for drawing attention to this gotcha.

Advansys Support

[This message was edited by Support 3 on April 21, 2004 at 09:00 PM.]