OpenWGA 7.10 - TMLScript reference

AFW.Util
Method :

dateRange(date1, date2)

On object AFW.Util
Usage Returns a human readable string for the date range.
Description

See samples below.

The result string currently is german only.

date1 or date 2 may be null.

Parameters

date1, date2 - Date objects

Return value date range string
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples
var d1 = WGA.Date("1.2.2020 10:00", "d.M.yyyy hh:mm")
var d2 = WGA.Date(d1).modify("d", 7)
return AFW.Util.dateRange(d1, d2)
// 1. bis 8. Feb 2020
    
var d2 = WGA.Date(d1).modify("M", 7)
return AFW.Util.dateRange(d1, d2)
// 1. Feb bis 1. Sep 2020
return AFW.Util.dateRange(d1, null) // ab 1. February 2020, 10:00 Uhr
return AFW.Util.dateRange(null, d2)
// bis 1. September 2020, 10:00 Uhr