我可以依赖从Google Places API PlaceResult对象返回的weekday_text对象吗?

时间:2015-04-22 09:00:21

标签: javascript google-places-api

来自Google Places API的PlaceResult对象中返回的opening_hours.weekday_text对象未记录在Places Library

我在文档中找不到对weekday_text的任何引用。鉴于this post表示“不要使用Google API的未记录属性”。他们可以并且确实随着每次发布而改变,我担心这可能会在未来发生变化。

我可以依赖应用程序中的opening_hours.weekday_text对象,还是应该使用opening_hours.periods对象生成打开/关闭数据?

示例结果......

"opening_hours": {
"open_now": true,
"periods": [
  {
    "close": {
      "day": 1,
      "time": "0000",
      "hours": 0,
      "minutes": 0,
      "nextDate": 1430089200000
    },
    "open": {
      "day": 0,
      "time": "0800",
      "hours": 8,
      "minutes": 0,
      "nextDate": 1430031600000
    }
  }
  ...
],
"weekday_text": [
  "Monday: 8:00 am – 11:00 pm",
  "Tuesday: 8:00 am – 11:00 pm",
  "Wednesday: 8:00 am – 11:00 pm",
  "Thursday: 8:00 am – 11:00 pm",
  "Friday: 8:00 am – 12:00 am",
  "Saturday: 8:00 am – 12:00 am",
  "Sunday: 8:00 am – 12:00 am"
]
},

1 个答案:

答案 0 :(得分:3)

我们更新了文档here,以包含weekday_text字段的详细信息。