Last active
March 8, 2020 17:25
-
-
Save Akeri/4db0d06b4de5ea4c5a9dc69e386b1734 to your computer and use it in GitHub Desktop.
Search along all Runtastic exported gpx by a date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const glob = require('glob'); | |
| const gpxParse = require('/usr/local/lib/node_modules/gpx-parse'); | |
| const moment = require('moment'); | |
| const exportDir = ''; | |
| const path = `${exportDir}/Sport-sessions/GPS-data/*.gpx`; | |
| glob.sync(path).forEach((file) => { | |
| gpxParse.parseGpxFromFile(file, (error, result) => { | |
| const time = result.tracks[0].segments[0][0].time; | |
| const date = moment(time); | |
| if (date.isAfter(moment('2020-03-07'))) { | |
| console.log(file); | |
| console.log(time); | |
| return false; | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment