Skip to main content

system.kanoa.shift.getClosestAncestorWithShifts

This function requires KanoaOps module

Description

Returns the assetPath with shifts associated to it, in order of the asset path tree. Returns None if no shifts are associated (kanoaOps).

Syntax

getClosestAncestorWithShifts(assetPath, rangeStart, rangeEnd, siteOffsetMins, deviceUTCOffsetHrs, counter)
  • Parameters
      assetPath (String) - Asset path.
      rangeStart (Datetime) - Start date of the range.
      rangeEnd (Datetime) - End date of the range.
      siteOffsetMins (Integer) - Site offset in minutes.
      deviceUTCOffsetHrs (Float) - Device UTC offset in hours.
      counter (int) - max number of ancestors to review
  • Returns
      AssetPath (String) or None.
  • Code Example

    # Example Usage:
    closestAncestor = system.kanoa.shift.getClosestAncestorWithShifts('someAssetPath', someStartDate, someEndDate, 60, 5.5, 3)