Android - 如何在规则中创建日期为 "until" 的重复事件?

Android - How can i create recurring event with "until" date in rrule?

如果我设置 [=25=,我可以在 google 日历中添加重复事件,而无需 "until" 规则中的日期] 规则中的日期未在 google 日历中创建事件。如何解决??

我的 ContentValue 是 "description=Test title=Monthly Event allDay=0 dtend=1572593453011 dtstart=1572591653011 calendar_id=2 eventLocation=null rrule=FREQ=MONTHLY;BYMONTHDAY=1;UNTIL=1580452756479"

如果我不给出 until 规则中的值,它将被保存到 google 日历,否则不保存

val values = ContentValues().apply {
            put(CalendarContract.Events.DTSTART, entity.dateTime.startsOn)

                put(CalendarContract.Events.DTEND, entity.dateTime.endsOn)


        put(CalendarContract.Events.ALL_DAY, if (entity.dateTime.isAllDay) 1 else 0)
        put(CalendarContract.Events.TITLE, entity.title.name)
        put(CalendarContract.Events.DESCRIPTION, entity.note.content)
        put(CalendarContract.Events.CALENDAR_ID, getPrimaryCalendarId())
        put(CalendarContract.Events.EVENT_TIMEZONE, Locale.getDefault().toString())
        put(CalendarContract.Events.EVENT_LOCATION, entity.location.address)
       put(CalendarContract.Events.RRULE,
                getRRule())

 }
  val uri: Uri = activity!!.contentResolver.insert(CalendarContract.Events.CONTENT_URI, values)!!
        eventID = uri.lastPathSegment!!.toLong()
        print("Event Id $eventID")

最终找到解决方案 UNTIL 接受日期格式为 yyyyMMdd'T'HHmmss'Z' 的值,例如“20191105T000000Z”。

内容值为"description=Test title=Monthly Event allDay=0 dtend=1572593453011 dtstart=1572591653011 calendar_id=2 eventLocation=null rrule=FREQ=MONTHLY;BYMONTHDAY=1;UNTIL=20191113T000000Z"。