1.1.0 • Published 3 years ago
@flowcore/time-bucket v1.1.0
Time Bucket
A Time Bucket utility library for facilitating working with flowcore time buckets
Configured Time
To get a configured time bucket key for a given time, use the GetTimeBucketKey function:
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:
import { TimeBucket } from '@flowcore/time-bucket';
const pattern = "YYYYMMDDHHmmss";
const timeBucketIncrement = TimeBucket.GetTimeBucketKey("YYYYMMDD", pattern).stripFrom;Installation
install with npm:
npm install @flowcore/time-bucketor yarn:
yarn add @flowcore/time-bucketUsage
Development
yarn installor with npm:
npm install