From a2f15377bed9fd352ce79d3aa04934365346fa94 Mon Sep 17 00:00:00 2001 From: Sven Seeberg Date: Wed, 6 May 2020 19:04:33 +0200 Subject: [PATCH] Use ISO 8601 date for FCM --- .../plugins/firebase-notifications/functions/rest_api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-content/plugins/firebase-notifications/functions/rest_api.php b/wp-content/plugins/firebase-notifications/functions/rest_api.php index 9ca3c5f99..cec4c983a 100644 --- a/wp-content/plugins/firebase-notifications/functions/rest_api.php +++ b/wp-content/plugins/firebase-notifications/functions/rest_api.php @@ -20,7 +20,9 @@ function fcm_rest_api_messages ( $language, $to = Null, $id = Null ) { foreach ( $messages as $message ) { if ( $message['answer'] != Null && ( $to === Null || $message['request']['to'] == "/topics/" . $to ) ) { $return[$n]['id'] = $message['id']; - $return[$n]['timestamp'] = $message['timestamp']; + $date = new DateTime( $message['timestamp'] ); + $timezone = new DateTimeZone( get_option( 'timezone_string' ) ); + $date = date_timezone_set( $date, $timezone ); $return[$n]['title'] = $message['request']['notification']['title']; $return[$n]['message'] = $message['request']['notification']['body']; $n++;