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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user