Skip to main content

system.kanoa.schedule.convertRecurringRuleToText(rruleStr, [locale])

Takes the rruleStr string object and returns human readable text for displaying to the user. With a locale, the text is in that language: each part is a translation term ("Repeats every %d weeks", "on %s", "on the last %s", "on day %d" and so on) and the day names are the language's own.


Parameters​

rruleStr String: i.e. 'FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,FR'

locale String: Optional. A locale such as session.props.locale; English if left out or None


Returns​

label String: 'Does not repeat' for None


Example​

rruleStr = 'FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,FR'
print system.kanoa.schedule.convertRecurringRuleToText(rruleStr)
> Repeats every 2 weeks on Monday, Friday
print system.kanoa.schedule.convertRecurringRuleToText('FREQ=MONTHLY;INTERVAL=1;BYDAY=FR(-1)')
> Repeats every month on the last Friday
print system.kanoa.schedule.convertRecurringRuleToText(rruleStr, self.session.props.locale)
> (in the session's language)