Talk:Getting started with Wikimedia APIs

Welcome to the discussion for the Getting started page! To leave a comment, select Edit.

Incorrect JavaScript example

Hey @APaskulin (WMF)! It seems that in these two lines:

let month = today.getMonth() + 1; 
let day = today.getDate();

The logic is incorrect, it should be instead:

let month = String(today.getMonth() + 1).padStart(2,'0'); 
let day = String(today.getDate()).padStart(2,'0');

as seen on this page API reference/Feed/Featured content - API Portal (wikimedia.org) Aranzate (talk) 05:30, 6 April 2023 (UTC)[reply]

Great catch! Thanks, @Aranzate! I've updated the code sample on this page. If you're interested in contributing to these docs, I'd be happy to add you to the documentation editors group, just let me know by leaving a comment on Talk:Community/Contributing. --APaskulin (WMF) (talk) 16:32, 6 April 2023 (UTC)[reply]