* Change a timestamp and enforce limits * @param timestamp * @protected
(timestamp: number)
| 68 | * @protected |
| 69 | */ |
| 70 | _safelySetTimestamp(timestamp: number) { |
| 71 | const min = this._minDate.valueOf() / 1000; |
| 72 | const max = this._maxDate.valueOf() / 1000; |
| 73 | |
| 74 | if (timestamp < min) { |
| 75 | timestamp = min; |
| 76 | } |
| 77 | if (timestamp > max) { |
| 78 | timestamp = max; |
| 79 | } |
| 80 | |
| 81 | this.timestamp = timestamp; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Modify a timestamp by a certain amount of days/months/years and enforce limits |
no test coverage detected