custom endpoint in strapi -- 2

Job ID: 31374688

Budget: $80 – $240 HKD

I've a created collection for blog articles, there are id, title, content, last_post_date. I want to count every post by last_post_date each day, each month and year. for example. the custom end point will return: 2021-01-01: 10, 2021-01-02: 5, 2021-01-03: 8, and so on. these for the days, and month will be: 2021-01: 500, 2021-02: 400, 2021-03: 146, and so on. for the year will be: 2019: 3000, 2020: 2500, 2021: 1000, the date should depends on the last_post_date from blog article collection, but the current custom endpoint didn't work as expected, which returned duplicated datetime.


datetime issue
fix the datetime to UTC+8
fix the duplicate return datetime
Related categories: JavaScript Node.js Backend Development