Yelp API 中的日期编号

Day numbering in Yelp API

当YelpAPIreturns一周中每一天的数据,比如营业时间,第一天为0,最后一天为6。是可以安全地假设 0 对应于星期日吗?

"hours": [
{
  "hours_type": "REGULAR",
  "open": [
    {
      "is_overnight": false,
      "end": "2200",
      "day": 0,
      "start": "1730"
    },
    {
      "is_overnight": false,
      "end": "2200",
      "day": 1,
      "start": "1730"
    },
    {
      "is_overnight": false,
      "end": "2200",
      "day": 2,
      "start": "1730"
    },
    {
      "is_overnight": false,
      "end": "2200",
      "day": 3,
      "start": "1730"
    },
    {
      "is_overnight": false,
      "end": "2200",
      "day": 4,
      "start": "1730"
    },
    {
      "is_overnight": false,
      "end": "2200",
      "day": 5,
      "start": "1730"
    },
    {
      "is_overnight": false,
      "end": "2200",
      "day": 6,
      "start": "1730"
    }
  ],
  "is_open_now": false
}

],

希望您使用的是最新的 api 版本 (v3)。 你可以参考 yelp api 文档 https://www.yelp.com/developers/documentation/v3/business 明确表示第 0-6 天应视为 周一至周日

来自文档

hours[x].open[x].day int From 0 to 6, representing day of the week from Monday to Sunday. Notice that you may get the same day of the week more than once if the business has more than one opening time slots.