{"id":41094,"library":"firestore-timestamp-formatter","title":"Firestore Timestamp Formatter","description":"Firestore Timestamp Formatter (v1.0.4) converts Firestore Timestamp objects to JavaScript Date objects automatically using Firestore's withConverter method. It eliminates the need for manual toDate() calls on each document field. The package is simple, focusing solely on timestamp conversion, and is compatible with any Firestore client library. It operates exclusively in the browser or Node.js environments that support Firestore.","status":"active","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/nosisky/firestore-timestamp-formatter","tags":["javascript","firestore","timestamp","formatter","firebase"],"install":[{"cmd":"npm install firestore-timestamp-formatter","lang":"bash","label":"npm"},{"cmd":"yarn add firestore-timestamp-formatter","lang":"bash","label":"yarn"},{"cmd":"pnpm add firestore-timestamp-formatter","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports a default converter object. Use ESM import as shown.","wrong":"const TimestampConverter = require('firestore-timestamp-formatter');","symbol":"TimestampConverter","correct":"import TimestampConverter from 'firestore-timestamp-formatter';"},{"note":"The default export is the object itself; there is no named export. Using curly braces will result in undefined.","wrong":"import { TimestampConverter } from 'firestore-timestamp-formatter';","symbol":"TimestampConverter (named import attempt)","correct":"import TimestampConverter from 'firestore-timestamp-formatter';"},{"note":"The package does not ship TypeScript definitions. You may need to declare a module or use @types if available.","wrong":"","symbol":"TypeScript types","correct":"import TimestampConverter from 'firestore-timestamp-formatter';"}],"quickstart":{"code":"import { initializeApp } from 'firebase/app';\nimport { getFirestore, doc, getDoc } from 'firebase/firestore';\nimport TimestampConverter from 'firestore-timestamp-formatter';\n\nconst firebaseConfig = { /* your config */ };\nconst app = initializeApp(firebaseConfig);\nconst db = getFirestore(app);\n\nconst docRef = doc(db, 'users', 'user123');\nconst docSnap = await getDoc(docRef.withConverter(TimestampConverter));\nif (docSnap.exists()) {\n  const data = docSnap.data();\n  console.log(data.createdAt); // Date object\n} else {\n  console.log('No such document!');\n}","lang":"typescript","description":"Fetch a Firestore document with automatic timestamp-to-Date conversion using withConverter."},"warnings":[{"fix":"Manually convert nested Timestamps using toDate() or apply the converter recursively.","message":"Only top-level Timestamp fields are converted; nested objects or arrays containing Timestamps are not converted.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a more comprehensive converter if you need to convert other types.","message":"The converter only handles Firestore Timestamp objects; it does not convert other Firestore types like GeoPoint or Reference.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using built-in Firestore conversion mechanisms or a community-maintained alternative.","message":"Package has not been updated in over 2 years; no compatibility guarantee with newer Firestore versions.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'automat':16 'browser':56 'call':29 'client':49 'compat':45 'convers':42 'convert':8 'date':14 'document':32 'elimin':23 'environ':59 'exclus':53 'field':33 'firebas':67 'firestor':1,4,9,18,48,62,64 'focus':38 'formatt':3,6,66 'javascript':13,63 'librari':50 'manual':27 'method':21 'need':25 'node.js':58 'object':11,15 'oper':52 'packag':35 'simpl':37 'sole':39 'support':61 'timestamp':2,5,10,41,65 'todat':28 'use':17 'v1.0.4':7 'withconvert':20","created_at":"2026-06-04T18:50:44.806775+00:00","updated_at":"2026-06-04T18:50:44.806775+00:00","problems":[{"fix":"Ensure all timestamp fields exist in the document or add a null check before using the converter.","cause":"The converter expects a Firestore Timestamp object at the field, but the field is missing or null.","error":"TypeError: Cannot read properties of undefined (reading 'seconds')"},{"fix":"Use default import: import TimestampConverter from 'firestore-timestamp-formatter';","cause":"The import may be incorrect or the converter object is undefined.","error":"FirebaseError: Function withConverter() requires a valid FirestoreDataConverter."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/nosisky/firestore-timestamp-formatter#readme","github":"https://github.com/nosisky/firestore-timestamp-formatter","docs":null,"changelog":null,"pypi":null,"npm":"firestore-timestamp-formatter","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}