今天同事跟我說他遇到了一個 javascript date 的 bug,
假設今天是 2016-10-31
2016-10-31
var date = new Date(); date.setMonth(8) console.log(date); //Sat Oct 01 2016 14:50:35 GMT+0800 (CST)
最近有一個專案需要用到 Google Place API, 我就用 Node.js 寫了一個搜尋附近景點,並且把 json 跟照片下載下來的功能,專案的 GitHub 就在這邊,其實整體程式碼不難,我有把設定檔抽出來變成 config.json 應該還滿容易編輯,我有點懶得貼上程式碼詳細講解了,所以我換個方法,講解我的架構跟介紹 Google Place API 這樣比較好讓人了解。
config.json