2018-08-13 14:59:37 +03:00
|
|
|
/**
|
|
|
|
* If we enable bluebird debug logs we see a huge memory usage.
|
|
|
|
* You can reproduce by removing this line and import a big database export into Ghost.
|
|
|
|
* `NODE_ENV=development node index.js`
|
|
|
|
*/
|
|
|
|
process.env.BLUEBIRD_DEBUG = 0;
|
|
|
|
|
2021-10-19 11:13:06 +03:00
|
|
|
const luxon = require('luxon');
|
2017-12-13 21:06:16 +03:00
|
|
|
const moment = require('moment-timezone');
|
2016-06-03 11:06:18 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* force UTC
|
2021-10-19 11:13:06 +03:00
|
|
|
* - old way: you can require moment or moment-timezone
|
|
|
|
* - new way: you should use Luxon - work is in progress to switch from moment.
|
|
|
|
*
|
2016-06-03 11:06:18 +03:00
|
|
|
* - you are allowed to use new Date() to instantiate datetime values for models, because they are transformed into UTC in the model layer
|
|
|
|
* - be careful when not working with models, every value from the native JS Date is local TZ
|
2021-10-19 11:13:06 +03:00
|
|
|
* - be careful when you work with date operations, therefore always wrap a date with our timezone library
|
2016-06-03 11:06:18 +03:00
|
|
|
*/
|
2021-10-19 11:13:06 +03:00
|
|
|
luxon.Settings.defaultZone = 'UTC';
|
2016-06-03 11:06:18 +03:00
|
|
|
moment.tz.setDefault('UTC');
|