import { UTCDate } from "@date-fns/utc"; import type { IActivityHandler } from "../../IActivityHandler"; /** Defines inputs to the Calculate Date activity. */ export interface CalculateDateInputs { date: "today" | "this-week" | "this-month" | "this-year" | string; useUtc?: boolean; offsetAmount?: number; offsetUnits?: "day" | "week" | "month" | "year" | string; } /** Defines outputs to the Calculate Date activity. */ export interface CalculateDateOutputs { /** @description The result as a Date object. */ date: Date; /** @description The result as the number of milliseconds since the Unix Epoch. Example: `1360017870652`. */ value: number; } export declare class CalculateDate implements IActivityHandler { static readonly action = "gcx:wf:core::CalculateDate"; static readonly suite = "gcx:wf:builtin"; execute(inputs: CalculateDateInputs): CalculateDateOutputs; getStartDate(startDate: string, utc: boolean): Date | UTCDate; private getMonthString; /** * Gets the time zone string for creating a new Date from a string. * We return an empty string for local values as that's automatically replaced with the local time zone. * Since it can seem misleading that Date.getTimezoneOffset() always returns the local offset * regardless of the value of the date, I prefer to not even reference a Date here. * @param utc * @returns The time zone string. */ private getTimeZone; private offsetDate; /** * Removes the time from the supplied date, leaving the year, month and date intact. * @param date The date to be altered. */ private removeTime; }