Skip to content

Commit

Permalink
fix(database): issue with date handling and accepted ios types
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Aug 8, 2022
1 parent 9f2d612 commit de62bfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/firebase-database/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function serialize(data: any): any {

case 'object': {
if (data instanceof Date) {
return NSDate.dateWithTimeIntervalSince1970(data.getTime() / 1000);
return data.toString();
}
if (!data) {
return NSNull.new();
Expand Down Expand Up @@ -396,7 +396,7 @@ export class Reference extends Query implements IReference {
const pushRef = Reference.fromNative(id);
let promise;
if (value) {
promise = thennablePushRef.set(value, onComplete).then(() => pushRef);
promise = thennablePushRef.set(serialize(value), onComplete).then(() => pushRef);
} else {
promise = Promise.resolve(pushRef);
}
Expand Down

0 comments on commit de62bfb

Please sign in to comment.