我想使用JavaScript从Google Calendar API中提取一些国家/地区的假期列表。
可能吗?我该怎么做?
答案 0 :(得分:10)
是的,使用google api可以做到这一点。
答案 1 :(得分:2)
google 为假期列表提供 API。
然后,在 url 中更改此文本
calendars/en.usa
此后,
这样,
"items": [
{
"kind": "calendar#event",
"etag": "\"3101513576000000\"",
"id": "20200101_60o30dr46oo30c1g60o30dr56g",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MjAyMDAxMDFfNjBvMzBkcjQ2b28zMGMxZzYwbzMwZHI1NmcgZW4udXNhI2hvbGlkYXlAdg",
"created": "2019-02-21T13:46:28.000Z",
"updated": "2019-02-21T13:46:28.000Z",
"summary": "New Year's Day",
"creator": {
"email": "en.usa#holiday@group.v.calendar.google.com",
"displayName": "Holidays in United States",
"self": true
},
"organizer": {
"email": "en.usa#holiday@group.v.calendar.google.com",
"displayName": "Holidays in United States",
"self": true
},
"start": {
"date": "2020-01-01"
},
"end": {
"date": "2020-01-02"
},
"transparency": "transparent",
"visibility": "public",
"iCalUID": "20200101_60o30dr46oo30c1g60o30dr56g@google.com",
"sequence": 0
},
{
.........
我们将在那里获取所有详细信息,例如, “摘要”键中的假日名称
"summary": "New Year's Day",