firebase timestamp to date angular
import { firestore } from 'firebase/app';
import Timestamp = firestore.Timestamp;
@Injectable()
export class YourService {
....
list = (): Observable<any[]> => this.collection
.snapshotChanges()
.pipe(
map(changes => {
return changes.map(a => {
const data = a.payload.doc.data() as any;
Object.keys(data).filter(key => data[key] instanceof Timestamp)
.forEach(key => data[key] = data[key].toDate())
data._id = a.payload.doc.id;
return data;
});
})
);
...
}
Also in JavaScript:
- javaScript disable submit button until form is fully validated
- javascript rpg tutorial
- target data option select vue js
- a open in new tab
- How many different types of JS alerts do we have?
- js get first letter of string
- jquery validator Url
- redirect to homepage javascript
- input text react 2020
- game winner pop up in javascript
- JAVASCRIPT EVENT.TARGET
- node start is too slow windows 10
- mule 4 json to string json
- ajax syntax in javascript
- javascript pad with leading zeros
- 3 = signs in javasdcript
- use bootstrap in react
- How do you wait for 5 seconds in JavaScript?
- javascript random number
- Exception in thread "main" org.openqa.selenium.JavascriptException:
- javascript radian to degree
- angular bind to class or ngClass
- firebase timestamp to date angular
- how to turn a number negative in javascript