classdef timeDifference < featlearn.operator.internal.binaryDatetime
    properties

    end
    methods
        function [this,T] = timeDifference(T)
            % construct base class
            this = this@featlearn.operator.internal.binaryDatetime(T);
            this = setOutputVarNames(this,T,'%s-%s','seconds(%s-%s)');
            % apply transfomation to data
            T = apply(this,T);
        end
        
        function T = apply(this,T)
            T = applyVec(this,T,@(x,y) seconds(y-x));
        end
        
        function str = details(this)
           str = string(message('stats:featlearn:FeatureTransformer:ElapsedTime',this.InputVarNames{1},this.InputVarNames{2}));
        end
    end
        
end