Support local time for scheduled pushes (#4137)

* Handle local push time

* PR feedback

* Improve timezone detection with regex

* Use indexOf instead of endsWith

* Add documentation

* Add end to end test for scheduled pushes in local time

* Revert changes to npm-git script

* clean up
This commit is contained in:
marvelm
2017-09-11 09:31:46 -04:00
committed by Florent Vilmart
parent 21f4411571
commit bc3cef2cd9
3 changed files with 151 additions and 16 deletions

View File

@@ -110,7 +110,7 @@ export function pushStatusHandler(config, objectId = newObjectId(config.objectId
const handler = statusHandler(PUSH_STATUS_COLLECTION, database);
const setInitial = function(body = {}, where, options = {source: 'rest'}) {
const now = new Date();
let pushTime = new Date();
let pushTime = now.toISOString();
let status = 'pending';
if (body.hasOwnProperty('push_time')) {
if (config.hasPushScheduledSupport) {
@@ -135,7 +135,7 @@ export function pushStatusHandler(config, objectId = newObjectId(config.objectId
const object = {
objectId,
createdAt: now,
pushTime: pushTime.toISOString(),
pushTime,
query: JSON.stringify(where),
payload: payloadString,
source: options.source,