Colorfulstan / LeagueJS

A Javascript Wrapper for the League of Legends API
MIT License
100 stars 7 forks source link

Update gettingListByAccount params beginTime,endTime documentation to be seconds #33

Closed giannic closed 2 weeks ago

giannic commented 1 year ago

Per https://developer.riotgames.com/apis#match-v5/GET_getMatchIdsByPUUID, this should be seconds

Also tried sample code using LeagueJS - Working with seconds (returns populated match id list):

const NOW = Date.now();
leagueJs.Match.gettingListByAccount(puuId, process.env.LEAGUE_API_PLATFORM_ID, {
  beginTime: Math.floor((NOW - 86400000)/1000), // 24 hours ago
  endTime: Math.floor(NOW/1000),                              
})

Not working with milliseconds (returns empty match id list):

const NOW = Date.now();
leagueJs.Match.gettingListByAccount(puuId, process.env.LEAGUE_API_PLATFORM_ID, {
  beginTime: NOW - 86400000, // 24 hours ago
  endTime: NOW,                              
})
giannic commented 1 year ago

Gentle nudge on this, thanks!

Colorfulstan commented 2 weeks ago

Hey, sorry for the long delay, I didn't get any Notifications from here and were not active on my personal Github since start of 2023.