Forum General DatabaseObject DateTime is incorrectly converted.

Discussion and help relating to the PlayerIO JavaScript SDK

DatabaseObject DateTime is incorrectly converted.

Postby atillabyte » May 7th, 2017, 8:06 pm

Code: Select all
@@ -2528,7 +2534,7 @@ PlayerIOErrorCode = {
                  target[key] = val.bytearray;
                  target[key].bytearray = true;
                  break;
-               case _pio.ValueType.DateTime: target[key] = new Date((val.datetime || 0) * 1000); break;
+               case _pio.ValueType.DateTime: target[key] = new Date(val.datetime || 0); break;
               case _pio.ValueType.Array:
                  var arr = target[key] instanceof Array ? target[key] : [];
                  _pio.bigDBDeserialize(val.arrayproperties, arr, false);


I'd like to add that a Date() object is formatted as the users local timezone.
I haven't determined whether this conflicts with DatabaseObject serialization.
atillabyte
 
Posts: 2
Joined: March 13th, 2017, 11:59 pm

Re: DatabaseObject DateTime is incorrectly converted.

Postby Emalton » May 7th, 2017, 10:22 pm

Nice catch Atilla!
Emalton
 
Posts: 70
Joined: June 28th, 2013, 3:49 am

Re: DatabaseObject DateTime is incorrectly converted.

Postby Henrik » May 19th, 2017, 4:53 am

Thanks for this bug report!

We've fixed it, and if you download the latest SDK now, you'll get the updated version.

Keep 'em coming! :D
Henrik
.IO
 
Posts: 1832
Joined: January 4th, 2010, 1:53 pm


Return to General



cron