From 255d05d2f5cce2cf9407c56b9752fbdadb6b8ec5 Mon Sep 17 00:00:00 2001 From: maltaisn Date: Mon, 5 Oct 2020 19:26:57 -0400 Subject: [PATCH] Update changelog and docs --- CHANGELOG.md | 5 ++++- lib/src/main/kotlin/com/maltaisn/recurpicker/Recurrence.kt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40c89b1..2eb6aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ ### v2.1.4 -- Updated kotlin to 1.4.0. +- Updated kotlin to 1.4.10. - Fixed layout issues with constrained width. - Fixed missing left and right margin in recurrence picker dialog for API <= 16. - Fixed dropdown widgets not wrapping width to content (introduced in 2.0.2). +- Fixed some issues with weekly recurrence with no days set (aka on same day as start date). + - `Recurrence.toString()` now returns "on same day as start date" for this case. + - `RRuleFormatter` correctly formats this case which otherwise resulted in invalid RRule. ### v2.1.3 - Introduced `rpListDialogMaxWidth` and `rpPickerDialogMaxWidth` attributes to limit the maximum size of dialogs on diff --git a/lib/src/main/kotlin/com/maltaisn/recurpicker/Recurrence.kt b/lib/src/main/kotlin/com/maltaisn/recurpicker/Recurrence.kt index 89034d8..3934127 100644 --- a/lib/src/main/kotlin/com/maltaisn/recurpicker/Recurrence.kt +++ b/lib/src/main/kotlin/com/maltaisn/recurpicker/Recurrence.kt @@ -120,6 +120,8 @@ public class Recurrence private constructor( * Returns true only if recurrence happens on all of these days. * To get the number of days set use `Integer.bitCount(recurrence.byDay) - 1` * (or `recurrence.byDay.countOneBits() - 1` in Kotlin). + * Note that if the weekly recurrence has no days set, meaning it happens on the same day as + * the start date's, this method will always return `false` since this day is unknown. * If period is [MONTHLY], checks if events happen on a certain day of the week specified * by a single flag set in [days]. * @param days A bit field of [DaysOfWeek] values. @@ -477,7 +479,8 @@ public class Recurrence private constructor( public const val FRIDAY: Int = 1 shl Calendar.FRIDAY public const val SATURDAY: Int = 1 shl Calendar.SATURDAY - public const val EVERY_DAY_OF_WEEK: Int = 0b11111111 // LSB is 1 to follow byDay layout so it can be used for comparison. + // LSB is 1 to follow byDay layout so it can be used for comparison. + public const val EVERY_DAY_OF_WEEK: Int = 0b11111111 /** Date value used for no end date. */ public const val DATE_NONE: Long = Long.MIN_VALUE