mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
make content releases use a given offset to the time.
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import moment from 'moment';
|
||||
import nconf from 'nconf';
|
||||
|
||||
const SWITCHOVER_TIME = nconf.get('CONTENT_SWITCHOVER_TIME_OFFSET') || 0;
|
||||
|
||||
function getDay (date) {
|
||||
if (date === undefined) {
|
||||
return 0;
|
||||
}
|
||||
return date instanceof moment ? date.date() : date.getDate();
|
||||
const checkDate = new Date(date.getTime());
|
||||
checkDate.setHours(checkDate.getHours() - SWITCHOVER_TIME);
|
||||
return checkDate.getDate();
|
||||
}
|
||||
|
||||
function getMonth (date) {
|
||||
|
||||
Reference in New Issue
Block a user