mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
FIX: recurring was not working for some cases (eg: hours and unit > 1) (#11657)
This commit is contained in:
@ -48,14 +48,14 @@ export default class LocalDateBuilder {
|
||||
});
|
||||
|
||||
if (this.recurring && moment().isAfter(localDate.datetime)) {
|
||||
const [count, type] = this.recurring.split(".");
|
||||
const type = this.recurring.split(".")[1];
|
||||
|
||||
const repetitionsForType = localDate.repetitionsBetweenDates(
|
||||
const repetitionsForType = localDate.unitRepetitionsBetweenDates(
|
||||
this.recurring,
|
||||
moment.tz(this.localTimezone)
|
||||
);
|
||||
|
||||
localDate = localDate.add(repetitionsForType + parseInt(count, 10), type);
|
||||
localDate = localDate.add(repetitionsForType, type);
|
||||
}
|
||||
|
||||
const previews = this._generatePreviews(localDate, displayedTimezone);
|
||||
|
Reference in New Issue
Block a user