Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"GetNewPosts" the option "timeframe: 'week' but it still fetches ALL post and not that submitted in a Week #103

Open
devvit-help-bot bot opened this issue Oct 18, 2024 · 0 comments
Labels

Comments

@devvit-help-bot
Copy link

Details

"GetNewPosts" the option "timeframe: 'week' but it still fetches ALL post and not that submitted in a Week

Additional info

Discord message: _I experienced the same. Got a timeframe "week" but it fetches all posts. I allready told <@892039441093365801> about it. Seems to be a Problem with ReddtiAPI maybe?
This is how i got around:

> const oneWeekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000;
>
> YOUR CODE
>
> // Filter timeframe before return
> const recentPosts = posts.filter(post => {
> const postCreatedAt = new Date(post.createdAt).getTime();
> return postCreatedAt >= oneWeekAgo;_

Message author: .robmc

Discord link: https://discord.com/channels/1050224141732687912/1050227353311248404/1295649436034269255

@pl00h pl00h added the bug label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant