UNPKG

gatsby-source-nytimes-books-api

Version:

This [GatsyJS](https://gatsbyjs.org) source plugin fetches data from the [NYTimes Books API](https://developer.nytimes.com/docs/books-product/1/overview)

14 lines (10 loc) 287 B
function getToday() { var d = new Date(), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear() if (month.length < 2) month = "0" + month if (day.length < 2) day = "0" + day return [year, month, day].join("-") } module.exports = getToday