import type { IActivityContext, IActivityHandler } from "../../IActivityHandler"; /** Defines inputs to the Format Date activity. */ export interface FormatDateInputs { date: string | number; format?: "LT" | "LTS" | "L" | "l" | "LL" | "ll" | "LLL" | "lll" | "LLLL" | "llll" | string; } /** Defines outputs to the Format Date activity. */ export interface FormatDateOutputs { /** @description The date formatted as per the `format` input. The current device (or browser) locale is used. */ formatted: string; /** @description The date formatted in the ISO8601 standard. Example: `2013-02-04T22:44:30.652Z`. */ iso: string; /** @description The date formatted as a standard english string in the local time zone. Example: `Mon Feb 04 2013 14:44:30 GMT-0800`. */ local: string; /** @description The number of milliseconds since the Unix Epoch. Example: `1360017870652`. */ unix: number; /** @description The date formatted as a standard english string using the UTC time zone. Example: `Mon, 04 Feb 2013 22:44:30 GMT`. */ utc: string; } export declare class FormatDate implements IActivityHandler { static readonly action = "gcx:wf:core::FormatDate"; static readonly suite = "gcx:wf:builtin"; execute(inputs: FormatDateInputs, context: IActivityContext): FormatDateOutputs; private getFormattedDate; /** * This method inspects a multi-character Custom date and time format string. * These are all described on this page: * * https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings * * We use the `CUSTOM_FORMAT_CHARS` namespace to describe the supported characters. * * @param customFormatString The format string to be inspected. * @param locale The locale to be used for localized characters, like separators. * @returns Details about how to format a date from the specified format string. */ private inspectCustomFormat; /** * This method inspects a single-character Custom date and time format string which is assumed to be * a Standard date and time format string. These are all described on this page: * * https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings * * We use the `STANDARD_FORMAT_STRINGS` namespace to describe each of the supported options. * * @param formatString A standard date and time format string * @param locale The current locale. * @returns Details to be used to format the date and time. */ private inspectStandardFormatString; private renderCustom; /** * This is used for a subset of the standard date and time format strings * which do not relate to an explicit custom equivalent. * With these constraints in mind, we can make some assumptions to simplify the code. * 1. The "abbreviated month" is never present. * 2. The "abbreviated day" is never present. * 3. The "full day" is never present. * @param dateTimeFormatParts The results of formatting a test date (2000-05-01 14:00:00) to parts. * @returns Our own details of the parts, for formatting the date from the activity inputs. */ private toCustomDateFormatParts; }