Conversation
* Handle empty timezones Signed-off-by: Arnau Mora <arnyminerz@proton.me> * Just check for empty timezones Signed-off-by: Arnau Mora <arnyminerz@proton.me> * Add clarifying comment Signed-off-by: Arnau Mora <arnyminerz@proton.me> --------- Signed-off-by: Arnau Mora <arnyminerz@proton.me>
* Update minSdkVersion * - Replace deprecated `closeCompat()` with standard `close()` - Remove compatibility method `closeCompat()` from `MiscUtils` --------- Co-authored-by: cketti <ck@cketti.de>
…update-event-validators # Conflicts: # lib/src/main/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistry.kt
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
|
|
||
| private val propertyRules = arrayOf( | ||
| TODO("ical4j 4.x"), | ||
| //CreatedPropertyRule(), // make sure CREATED is UTC |
There was a problem hiding this comment.
CreatedPropertyRule was removed from ical4j 4.x. But it looks like we could use ChangeManagementPropertyValidators.CREATED instead.
There was a problem hiding this comment.
I wonder why we did have this rule. According to ical4j (I don't remember where I saw it) this was like this to make sure the parsing went well. With the migration to Java 8 APIs, parsing can go well even if the created dates are not UTC.
Maybe @rfc2822 has other reasons why to keep it.
There was a problem hiding this comment.
We had a problem with unparsable DTSTAMP that was not a UTC timestamp once: bitfireAT/ical4android#34
And I think the CreatedPropertyRule fixed the same type of problem for CREATED.
However ical4j 4.x doesn't have problems with theses cases:
@Test
fun testDtstampWithTimezone() {
val iCal = "BEGIN:VCALENDAR\n" +
"BEGIN:VEVENT\n" +
"DTSTART:16010101T020000\n" +
"SUMMARY:Test\n" +
"DTSTAMP;VALUE=DATE-TIME:20220331T084614\n" +
"CREATED;VALUE=DATE-TIME:20220331T084614\n" +
"END:VEVENT\n" +
"END:VCALENDAR\n"
val cal = CalendarBuilder().build(StringReader(iCal))
val e = cal.getComponent<VEvent>(Component.VEVENT).get()
assertEquals("20220331T084614Z", e.dateTimeStamp.value)
assertEquals("20220331T084614Z", e.created.value)
}So I think it's fine to remove that rule.
lib/src/main/kotlin/at/bitfire/synctools/icalendar/Ical4jHelpers.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
preprocessCalendarandapplyRulesinICalPreprocessorto new syntax.