English 中文(简体)
1. 创造重复的经常性活动 第三星期二每月
原标题:Create a recurring event that repeats Monthly on the third Tuesday

使用谷歌应用日历服务(而不是Calendar 预报 Service )可以制作一个经常性活动,在一周前每月重复? 例如,系列中的第一个活动是3月21日星期二。 我希望每月在本月第三星期二再次举行这一活动。 我最接近完成这项工作的是:

var recurrence = CalendarApp.newRecurrence();
recurrence = recurrence.addMonthlyRule()
    .interval(this.repeatMonths)
    .onlyOnWeekday(CalendarApp.Weekday[dayOfWeek]);

是否有任何人知道这样做的方法?

问题回答

这将产生一个活动,将每月第三星期二从10am撤回到12pm。 第一次活动将于2018年9月11日举行,最后一次活动将是2019年3月12日。 你显然需要从你的数据中建立参数的关键部分。

var recurringEvent = myCal.createEventFromDescription("Event Title, the third Tuesday of each Month, 10-12, 2018-09-11 until 2019-03-13");

这似乎是一种最坏的ir。 必须找到更好的办法处理一系列顺序。 为什么不能有活力地获得一周的目标之一? 动手表示,这似乎行之有效。

var start = new Date();  // The event start date
var numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];
var days = [
  CalendarApp.Weekday.SUNDAY,
  CalendarApp.Weekday.MONDAY,
  CalendarApp.Weekday.TUESDAY,
  CalendarApp.Weekday.WEDNESDAY,
  CalendarApp.Weekday.THURSDAY,
  CalendarApp.Weekday.FRIDAY,
  CalendarApp.Weekday.SATURDAY
];
var weekday = days[start.getDay()];
var monthday = start.getDate();
var mod = monthday % 7 - 1;
var good_days = numbers.slice(monthday-mod, monthday-mod+7)

var recurrence = CalendarApp.newRecurrence();
recurrence.addWeeklyRule().onlyOnWeekday(weekday).onlyOnMonthDays(good_days);

一般想法是确定该月哪个星期的日期。 页: 1 然后每月复发,时间限定在适当的星期日。 最后,将每月的天数限制在可能导致同一月的一周内。

如果,则肯定是ice。 有一个旗帜,可以按月顺序重新命名。

I tried this way and i worked, hope this will work for anyone who still are in confusion

 Calendar calendar = GregorianCalendar.getInstance();
            calendar.set(calendar.get(Calendar.YEAR),
                    calendar.get(Calendar.MONTH),
                    calendar.get(Calendar.DAY_OF_MONTH),
                    calendar.get(Calendar.HOUR_OF_DAY),
                    calendar.get(Calendar.MINUTE),
                    calendar.get(Calendar.SECOND));



calendar.set(Calendar.DAY_OF_WEEK, calendar.get(Calendar.DAY_OF_WEEK)); // Thursday
            calendar.set(Calendar.DAY_OF_WEEK_IN_MONTH, 3); // third day of month

            alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),AlarmManager.INTERVAL_DAY * (7*4) ,pendingIntent);




相关问题
Google Calendar embeds - but won t respond

I successfully embedded the Google Calendar IFRAME, however, without any JS error -- it won t respond to any of my clicks, nor display any events. After double checking the calendar settings and ...

CalDav on Outlook? [closed]

I m looking for a good way to view CalDav calendars within Outlook. I m aware of the OpenConnector project, but have not been happy with it thus far (re: stability issues & difficulty to ...

Java and Google Calendar

I would be shocked if this were immediately answered here, as this is a question specific to the Google Calendar Java API, but I ll put it out there anyway. The tutorials for Google Calendar give a ...

google calendar java api

I have an object of CalendarEntry I know that http://www.google.com/calendar/feeds/example@gmail.com/allcalendars/full is the feed url of all calendars but how I can get this feed url from ...

Developing a Firefox extension for Google Calendar

I am actually not so sure if it is possible but It would be great for me to have a firefox add-on to add/remove/edit/delete for google calendar. Is there any blog entry or a reference documents about ...

热门标签