@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
56 lines • 1.88 kB
TypeScript
import * as i0 from "@angular/core";
export type Measurement = number | {
min: number;
max: number;
};
export interface SeriesInfo {
unit: string | null | undefined;
name: string;
type: string | null | undefined;
}
export interface SourceData {
series: SeriesInfo[];
values: {
[timestamp: string]: (Measurement | null)[] | undefined;
};
truncated: boolean;
}
export interface SourceItem {
source: string | number;
data: SourceData;
}
export interface TransformedSeries {
values: {
[timestamp: string]: Measurement;
} | null;
seriesDetails: SeriesInfo;
}
export interface TransformedSource {
[seriesType: string]: TransformedSeries;
}
export interface TransformedData {
[sourceId: string]: TransformedSource;
}
export declare class UtilsService {
transformDataStructure(data: SourceItem[]): TransformedData;
/**
* Formats a date range into a specific string format, handling UTC dates correctly.
*
* @param fromDate - The start date in ISO format (e.g., "2023-12-04T12:40:00.000Z")
* @param toDate - The end date in ISO format (e.g., "2023-12-06T23:50:00.000Z")
* @returns A string representing the date range in the format "ddmmmyyhhmm-ddmmmyyhhmm"
* where d=day, m=month, y=year, h=hour, m=minute
*
* Example
* ```typescript
* const fromDate = "2023-12-04T12:40:00.000Z";
* const toDate = "2023-12-06T23:50:00.000Z";
* const formattedRange = getFormattedDateRange(fromDate, toDate);
* console.log(formattedRange); // Output: "04dec231240-06dec232350"
* ```
*/
getFormattedDateRange(fromDate: string, toDate: string): string;
static ɵfac: i0.ɵɵFactoryDeclaration<UtilsService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<UtilsService>;
}
//# sourceMappingURL=utils.service.d.ts.map