Anne-Charlotte commited on
Commit
b64bd68
·
verified ·
1 Parent(s): 3ec0c6b

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +7 -4
script.js CHANGED
@@ -50,10 +50,13 @@ const stepsData = [
50
  { timestamp: "45:03", title: "Fix the Antennas" },
51
  ];
52
 
53
- // Parse timestamp to seconds
54
- function parseTimestamp(ts) {
55
- const parts = ts.split(':').map(Number);
56
- return parts[0] * 3600 + parts[1] * 60 + parts[2];
 
 
 
57
  }
58
 
59
  // Create assembly steps with parsed timestamps
 
50
  { timestamp: "45:03", title: "Fix the Antennas" },
51
  ];
52
 
53
+ // Convert timestamp string "MM:SS" or "HH:MM:SS" to seconds
54
+ function parseTimestamp(ts: string): number {
55
+ const parts = ts.split(':').map(Number);
56
+ if (parts.length === 2) {
57
+ return parts[0] * 60 + parts[1];
58
+ }
59
+ return parts[0] * 3600 + parts[1] * 60 + parts[2];
60
  }
61
 
62
  // Create assembly steps with parsed timestamps