Commit a522af62 authored by Ricki Hirner's avatar Ricki Hirner

Upgrade libraries

parent 4604c15f
buildscript {
ext.kotlin_version = '1.1.51'
ext.kotlin_version = '1.1.61'
ext.dokka_version = '0.9.15'
repositories {
......@@ -11,7 +11,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:${dokka_version}"
}
......@@ -52,7 +52,7 @@ android {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'org.mnode.ical4j:ical4j:2.1.4'
compile 'org.mnode.ical4j:ical4j:2.1.5'
compile 'org.slf4j:slf4j-jdk14:1.7.25'
androidTestCompile 'org.projectlombok:lombok:1.16.16'
......
......@@ -8,13 +8,16 @@
package at.bitfire.ical4android
import net.fortuna.ical4j.data.CalendarBuilder
import net.fortuna.ical4j.model.*
import net.fortuna.ical4j.model.Date
import net.fortuna.ical4j.model.TimeZone
import net.fortuna.ical4j.model.component.VTimeZone
import net.fortuna.ical4j.model.parameter.Value
import net.fortuna.ical4j.model.property.DateListProperty
import net.fortuna.ical4j.model.property.ExDate
import net.fortuna.ical4j.model.property.RDate
import java.io.StringReader
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
......@@ -73,6 +76,23 @@ object DateUtils {
return deviceTZ
}
/**
* Parses a VTIMEZONE definition to a VTimeZone object.
* @param timezoneDef VTIMEZONE definition
* @return parsed VTimeZone
* @throws IllegalArgumentException when the timezone definition can't be parsed
*/
@JvmStatic
fun parseVTimeZone(timezoneDef: String): VTimeZone {
val builder = CalendarBuilder(tzRegistry)
try {
val cal = builder.build(StringReader(timezoneDef))
return cal.getComponent(VTimeZone.VTIMEZONE) as VTimeZone
} catch (e: Exception) {
throw IllegalArgumentException("Couldn't parse timezone definition")
}
}
// recurrence sets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment