OpenWGA 7.7 - TMLScript reference

WGA
Method :

dateOnly(date)

On object WGA
Usage Removes all daytime information from a date
Description

This method returns a new date which represents the date give but has hour, minute, second and millisecond information set to 0. So this date represents the day at second 0.

This method can be useful if you want to compare dates only on behalf of the day that they represent. Dates that are on the same day but with different daytimes will be equal when run through this method.

Parameters

date (Date):

The date object

Return value Date object with resetted daytime information
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples

Comparing dates only for their day information:

if (WGA.dateOnly(date1) == WGA.dateOnly(date2)) {

  return true;

}

else {

  return false;

}