@multisystemsuite/timezone-engine-analytics
v5.0.0
Published
Timezone analytics aggregation for @multisystemsuite/timezone-engine
Maintainers
Readme
@multisystemsuite/timezone-engine-analytics
Timezone analytics aggregation for dashboards, reporting windows, and executive summaries.
What it is used for
- Aggregate events/records by user or site timezone
- Build timezone-aware reporting windows (start/end in UTC)
- Analytics platforms with global user bases
- ERP/HRMS dashboards showing regional distribution
Install
npm install @multisystemsuite/timezone-engine-analyticsUsage
import {
aggregateByTimezone,
createReportingWindow,
summarizeTimezoneDistribution,
} from "@multisystemsuite/timezone-engine-analytics";
const records = [
{ timezone: "America/New_York", value: 10 },
{ timezone: "Asia/Kolkata", value: 25 },
{ timezone: "Asia/Kolkata", value: 5 },
];
const buckets = aggregateByTimezone(records);
const summary = summarizeTimezoneDistribution(records);
const window = createReportingWindow({
timezone: "Asia/Kolkata",
startLocal: new Date("2026-05-01T00:00:00"),
endLocal: new Date("2026-05-31T23:59:59"),
});
// window.startUTC, window.endUTC for SQL queriesWith React
import { useTimezoneAnalytics } from "@multisystemsuite/timezone-engine-react";
function Dashboard({ records }) {
const { summary, buckets } = useTimezoneAnalytics(records);
return <pre>{JSON.stringify(buckets, null, 2)}</pre>;
}Key exports
| Export | Purpose |
| --------------------------------- | -------------------------- |
| aggregateByTimezone() | Count records per timezone |
| createReportingWindow() | Local range → UTC bounds |
| summarizeTimezoneDistribution() | Total + bucket breakdown |
Related packages
@multisystemsuite/timezone-engine-core— formatting and conversion@multisystemsuite/timezone-engine-react—useTimezoneAnalyticshook
Keywords
timezone, analytics, reporting, aggregation, dashboard, enterprise
License
MIT
