/**
 * Copyright 2017 - 2018  The Hyve B.V.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */ import { Constraint } from './constraint' ; import { DateOperatorState } from './date-operator-state' ; export class TimeConstraint extends Constraint { dateOperator : DateOperatorState = DateOperatorState . BETWEEN ; date1 : Date = new Date ( ) ; date2 : Date = new Date ( ) ; private _isObservationDate = false ; constructor ( ) { super ( ) ; this . textRepresentation = 'Time constraint' ; } get className ( ) : string { return 'TimeConstraint' ; } get isObservationDate ( ) : boolean { return this . _isObservationDate ; } set isObservationDate ( value ) { this . _isObservationDate = value ; } clone ( ) { const clone = new TimeConstraint ( ) ; clone . dateOperator = this . dateOperator ; clone . date1 = this . date1 ; clone . date2 = this . date2 ; clone . isObservationDate = this . isObservationDate ; clone . negated = this . negated ; return clone ; } }