mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix merge
This commit is contained in:
@@ -839,7 +839,7 @@ function makeMatcherClass () {
|
||||
};
|
||||
}
|
||||
|
||||
export function getAllScheduleMatchingGroups (date) {
|
||||
export function getScheduleMatchingGroup (type, date) {
|
||||
const checkedDate = date || new Date();
|
||||
if (cacheDate !== null && (getDay(checkedDate) !== getDay(cacheDate)
|
||||
|| getMonth(checkedDate) !== getMonth(cacheDate))) {
|
||||
@@ -853,6 +853,7 @@ export function getAllScheduleMatchingGroups (date) {
|
||||
if (!cachedScheduleMatchers[matcher.type]) {
|
||||
cachedScheduleMatchers[matcher.type] = makeMatcherClass();
|
||||
}
|
||||
cachedScheduleMatchers[matcher.type].end = end.toDate();
|
||||
if (matcher.matcher instanceof Function) {
|
||||
cachedScheduleMatchers[matcher.type].matchers.push(matcher.matcher);
|
||||
} else if (matcher.items instanceof Array) {
|
||||
@@ -861,19 +862,14 @@ export function getAllScheduleMatchingGroups (date) {
|
||||
});
|
||||
}
|
||||
if (!cachedScheduleMatchers[type]) {
|
||||
let end = moment(checkedDate).date(TYPE_SCHEDULE[type]);
|
||||
if (end.date() <= checkedDate.date()) {
|
||||
end = moment(end).add(1, 'months');
|
||||
}
|
||||
return {
|
||||
end: end.toDate(),
|
||||
items: [],
|
||||
match () {
|
||||
return true;
|
||||
},
|
||||
};
|
||||
}
|
||||
return matchingGroups[type];
|
||||
return cachedScheduleMatchers[type];
|
||||
}
|
||||
|
||||
export function getCurrentGalaKey (date) {
|
||||
|
||||
Reference in New Issue
Block a user