Merge pull request #10950 from AlexSCorey/10947-fix

Fixes erroneous pluralization from rrule
This commit is contained in:
Alex Corey 2021-08-27 16:20:05 -04:00 committed by GitHub
commit db34423af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 8527 additions and 7980 deletions

View File

@ -138,10 +138,18 @@ function ScheduleDetail({ hasDaysToKeepField, schedule, surveyConfig }) {
}, [fetchCredentialsAndPreview]);
const rule = rrulestr(rrule);
const repeatFrequency =
let repeatFrequency =
rule.options.freq === RRule.MINUTELY && dtstart === dtend
? t`None (Run Once)`
: rule.toText().replace(/^\w/, (c) => c.toUpperCase());
// We should allow rrule tot handle this issue, and they have in version 2.6.8.
// (https://github.com/jakubroztocil/rrule/commit/ab9c564a83de2f9688d6671f2a6df273ceb902bf)
// However, we are unable to upgrade to that version because that
// version throws and unexpected warning.
// (https://github.com/jakubroztocil/rrule/issues/427)
if (repeatFrequency.split(' ')[1] === 'minutes') {
repeatFrequency = t`Every minute for ${rule.options.count} times`;
}
const {
ask_credential_on_launch,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff