Closed SureshKumarToverto closed 8 months ago
5.4.0
createdOn= new Date(); // gives such result in firestore with string type // createdOn: "2018-11-16T09:48:51.137Z"
what is the best way to save date as a timestamp createdOn
https://github.com/capawesome-team/capacitor-firebase/tree/main/packages/firestore
import { FirebaseFirestore } from '@capacitor-firebase/firestore'; this.logDataGlobal.createdOn = Date.now(); this.logDataGlobal.uuid = deviceId.identifier; this.logDataGlobal.username = localStorage.getItem('username'); this.logDataGlobal.activestatus = true;
addFirebase(logDatas): void { FirebaseFirestore.addDocument({ reference: 'mlogs', data: logDatas, }); }
No response
ionic cap build android
This is currently a bug in Capacitor (see https://github.com/ionic-team/capacitor/issues/7252). I close this as duplicate of #474.
Plugin(s)
Version
5.4.0
Platform(s)
Current behavior
createdOn= new Date(); // gives such result in firestore with string type // createdOn: "2018-11-16T09:48:51.137Z"
Expected behavior
what is the best way to save date as a timestamp createdOn
Reproduction
https://github.com/capawesome-team/capacitor-firebase/tree/main/packages/firestore
Steps to reproduce
import { FirebaseFirestore } from '@capacitor-firebase/firestore'; this.logDataGlobal.createdOn = Date.now(); this.logDataGlobal.uuid = deviceId.identifier; this.logDataGlobal.username = localStorage.getItem('username'); this.logDataGlobal.activestatus = true;
addFirebase(logDatas): void { FirebaseFirestore.addDocument({ reference: 'mlogs', data: logDatas, }); }
Other information
No response
Capacitor doctor
ionic cap build android
Before submitting