Skip to content

Commit

Permalink
Enable time index offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Rdornier committed Oct 27, 2023
1 parent eb6c3ea commit 7f49a6e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/js/models/panel_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,21 @@
deltaT = this.get('deltaT')[theT] || 0,
text = "", h, m, s;

var shiftIdx;
if (ref_idx) {
var shift = this.get('deltaT')[parseInt(ref_idx)-1];
deltaT = shift==null ? deltaT : deltaT-shift;
shiftIdx = parseInt(ref_idx)
var shift = this.get('deltaT')[shiftIdx - 1];
deltaT = shift==null ? deltaT : deltaT - shift;
}
var isNegative = (deltaT < 0);
deltaT = Math.abs(deltaT);

var padlen = dec_prec>0 ? dec_prec+3 : 2;
if (format === "index") {
isNegative = false;
text = "" + (theT + 1);
if(!isNaN(shiftIdx) && !(this.get('deltaT')[shiftIdx - 1] == null))
text = "" + (theT - shiftIdx + 1);
else text = "" + (theT + 1);
} else if (['milliseconds', 'ms'].includes(format)) {
text = (deltaT*1000).toFixed(dec_prec) + " ms";
} else if (['seconds', 'secs', 's'].includes(format)) {
Expand Down

0 comments on commit 7f49a6e

Please sign in to comment.