// Access timeline for a specific unitconst timeline = entity.timeline('day')// Get timeline cursor methodsconst cursor = timeline.cursor// Increment a specific time periodawait cursor.increment(firestore.Timestamp.now(), { count: 1, value: 99.99})
When events cross day boundaries, they’re correctly assigned:
Copy
// Event at 11 PM Pacific Timeconst event = { time: firestore.Timestamp.fromDate(new Date('2024-01-15T23:00:00-08:00')), value: 100}// With Pacific timezone, this goes to Jan 15await incrementMetric('sales', 'revenue', 'store-123', event)// With UTC, this would go to Jan 16 (since 11 PM PST = 7 AM UTC next day)