How to save date in Angular as a timestamp to Firestore #564
Labels
bug/fix
Something isn't working
duplicate
This issue or pull request already exists
package: firestore
platform: android
Android platform
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
The text was updated successfully, but these errors were encountered: