A Time Bucket utility library for facilitating working with flowcore time buckets
npm install @flowcore/time-bucketA Time Bucket utility library for facilitating working with flowcore time buckets
To get a configured time bucket key for a given time, use the GetTimeBucketKey function:
``typescript
import { TimeBucket } from '@flowcore/time-bucket';
const pattern = "YYYYMMDDHHmmss";
const timeBucket = TimeBucket.create("YYYYMMDD", pattern);
const timeBucketKey = timeBucket(days()).format(pattern);
`
to get the configured time bucket increment for a given time pattern, use the GetTimeBucketKey function:
`typescript
import { TimeBucket } from '@flowcore/time-bucket';
const pattern = "YYYYMMDDHHmmss";
const timeBucketIncrement = TimeBucket.GetTimeBucketKey("YYYYMMDD", pattern).stripFrom;
`
install with npm:
`bash`
npm install @flowcore/time-bucket
or yarn:
`bash`
yarn add @flowcore/time-bucket
`bash`
yarn install
or with npm:
`bash``
npm install