pierremtb / easy-fit

Parse your .FIT files easily, directly from JS
Other
70 stars 51 forks source link

Add `timer_time` field to `record` #32

Closed nholden closed 4 years ago

nholden commented 5 years ago

Currently, records fields have an elapsed_time field that tells us how many seconds have passed since the start of the activity.

This change adds a timer_time field to records. It's different from elapsed_time because elapsed_time tells us the total time that has passed since the activity started, including pauses/rests. timer_time that tells us the time shown on the device when the record happened.

Example record payloads

Before this change

{
  "timestamp": "2019-03-09T18:36:11.000Z",
  "elapsed_time": 4569,
  "position_lat": 32.75025587528944,
  "position_long": -117.13018745183945,
  "distance": 14.16679,
  "altitude": 0.11679999999999996,
  "speed": 8.686285714285715,
  "heart_rate": 150,
  "cadence": 81,
  "temperature": 15,
  "fractional_cadence": 0
}

After this change

{
  "timestamp": "2019-03-09T18:36:11.000Z",
  "elapsed_time": 4569,
  "timer_time": 4480,
  "position_lat": 32.75025587528944,
  "position_long": -117.13018745183945,
  "distance": 14.16679,
  "altitude": 0.11679999999999996,
  "speed": 8.686285714285715,
  "heart_rate": 150,
  "cadence": 81,
  "temperature": 15,
  "fractional_cadence": 0
}

closes https://github.com/pierremtb/easy-fit/issues/29

jimmykane commented 5 years ago

@nholden I have "merged" this to the repo https://github.com/jimmykane/fit-parser It's different npm package to since I cannot update this lib. That package is a fork of this one, no modification except updates on FIT SDK and the contributions.