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