mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
Move from deprecated moment#zone to moment#utcOffset (#12207)
* Issue 10209 - Remove read usages of zone * Issue 10209 - Add coverage on daysSince and startOfDay cron utility functions * Issue 10209 - Add unit test for daysUserHasMissed method * Issue 10209 - Remove usages of deprecated `moment.js#zone` method. * Issue 10209 - Add helper function to centralise logic Also simplify timezoneOffsetToUtc function in site.vue * Issue 10209 - Also add getUtcOffset as method on user Co-authored-by: Matteo Pagliazzi <matteopagliazzi@gmail.com>
This commit is contained in:
@@ -64,7 +64,7 @@ async function cronAsync (req, res) {
|
||||
|
||||
user = await User.findOne({ _id: user._id }).exec();
|
||||
res.locals.user = user;
|
||||
const { daysMissed, timezoneOffsetFromUserPrefs } = user.daysUserHasMissed(now, req);
|
||||
const { daysMissed, timezoneUtcOffsetFromUserPrefs } = user.daysUserHasMissed(now, req);
|
||||
|
||||
await updateLastCron(user, now);
|
||||
|
||||
@@ -94,7 +94,7 @@ async function cronAsync (req, res) {
|
||||
now,
|
||||
daysMissed,
|
||||
analytics,
|
||||
timezoneOffsetFromUserPrefs,
|
||||
timezoneUtcOffsetFromUserPrefs,
|
||||
headers: req.headers,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user