Skip to main content

system.kanoa.date.getDateRange

Description

Returns predefined date ranges. If assetPath is provided, 'Current Run', 'Current Shift' and 'Previous Shift' dates can be returned

Syntax

getDateRange(paramsDict)
  • Parameters:
      paramsDict (dict)
      selectedDateRange (str): valid values are 'Current Run', 'Current Shift', Previous Shift', Today, 'Yesterday', This Week', 'Last Week', 'This Month', 'Last Month', 'Year To Date', 'Last 24 Hrs', 'Last 7 Days', 'Last 14 Days'
      clientTimeZone (string): i.e. America/Los Angeles
      assetPath (string)
  • Returns:
      startDate (datetime)
      endDate (datetime)
  • Code Example

    # Example Usage:
    paramsDict = {'selectedDateRange': 'Today', 'clientTimeZone': 'America/Los Angeles', 'assetPath': None}
    startDate, endDate = system.kanoa.date.getDateRange(paramsDict)