@leapdevuk/component-toolbox 0.0.128 → 0.0.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ export { formatAsDBDate as lctFormatAsDBDate } from './utils';
4
4
  export { formatDate as lctFormatDate } from './utils';
5
5
  export { formatDateTime as lctFormatDateTime } from './utils';
6
6
  export { formatReportDate as lctFormatReportDate } from './utils';
7
- export { getFormattedLocalDateTime as lctGetFormattedLocalDateTime } from './utils';
7
+ export { convertLocalDateToUTCDateTime as lctConvertLocalDateToUTCDateTime } from './utils';
8
8
  export { getLocale as lctGetLocale } from './utils';
9
9
  export { parseDate as lctParseDate } from './utils';
10
10
  export { utcFormat as lctUTCFormat } from './utils';
@@ -170,11 +170,11 @@ export declare const getLocale: (leapContext?: LeapContext) => Locale | undefine
170
170
  /**
171
171
  * This function formats a date or datetime value into a string based on the provided locale.
172
172
  * It supports both date-only and datetime formats, and can handle UTC dates.
173
- * @param value (string | Date | undefined): The date or datetime value to format.
173
+ * @param inputValue (string | Date | undefined): The date or datetime value to format.
174
174
  * @param locale (Locale | undefined): The locale to use for formatting. If undefined, it will not format the date.
175
- * @param isUtc (boolean): Whether the date is in UTC format. Defaults to true.
176
- * @param dateOnly (boolean): Whether to format the value as a date only.
177
- * @param show24H (boolean): Whether to show the time in 24-hour format. Defaults to false.
175
+ * @param outputAsUtc (boolean): Whether the date is in UTC format. Defaults to true.
176
+ * @param outputAsDateOnly (boolean): Whether to format the value as a date only.
177
+ * @param outputAs24H (boolean): Whether to show the time in 24-hour format. Defaults to false.
178
178
  * @returns (string): A formatted date or datetime string. If the input value is invalid or locale is undefined, it returns an empty string.
179
179
  * @example
180
180
  * ```typescript
@@ -184,7 +184,7 @@ export declare const getLocale: (leapContext?: LeapContext) => Locale | undefine
184
184
  * const formattedInvalid = lctFormatDateTime(undefined, enGB); // Returns ""
185
185
  * ```
186
186
  */
187
- export declare const formatDateTime: (value?: string | Date, locale?: Locale, isUtc?: boolean, dateOnly?: boolean, show24H?: boolean) => string;
187
+ export declare const formatDateTime: (inputValue?: string | Date, locale?: Locale, outputAsUtc?: boolean, outputAsDateOnly?: boolean, outputAs24H?: boolean) => string;
188
188
  /**
189
189
  * This function formats a date string into a report-friendly format based on the provided locale.
190
190
  * It handles both ISO date strings and strings in the format "yyyy-MM-dd".
@@ -234,26 +234,22 @@ export declare const formatAsDBDate: (date: Date) => string;
234
234
  * This function formats a date or datetime value into a string based on the provided locale.
235
235
  * It supports both date-only and datetime formats, and can handle UTC dates.
236
236
  * It also allows for formatting the start or end of the day.
237
- * @param value (string | Date | undefined): The date or datetime value to format.
237
+ * @param inputValue (string | Date | undefined): The date or datetime value to format.
238
238
  * @param locale (Locale | undefined): The locale to use for formatting. If undefined, it will not format the date.
239
- * @param isUtc (boolean): Whether the date is in UTC format. Defaults to true.
240
- * @param dateOnly (boolean): Whether to format the value as a date only.
241
- * @param show24H (boolean): Whether to show the time in 24-hour format. Defaults to false.
242
- * @param formatString (string): The format string to use for formatting the date. If not provided, it defaults to the locale's short date format.
243
- * @param formatStartOfDay (boolean): If true, formats the date to the start of the day.
244
- * @param formatEndOfDay (boolean): If true, formats the date to the end of the day.
239
+ * @param outputAsStartOfDay (boolean): If true, formats the date to the start of the day.
240
+ * @param outputAsEndOfDay (boolean): If true, formats the date to the end of the day.
245
241
  * @returns (string): A formatted date or datetime string. If the input value is invalid or locale is undefined, it returns an empty string.
246
242
  * @example
247
243
  * ```typescript
248
- * const formattedDate = getFormattedLocalDateTime(new Date(), enGB, true, false, true); // Returns "01/01/2023 14:30"
249
- * const formattedDateTime = getFormattedLocalDateTime("2023-01-01T14:30:00Z", enUS, true, false, false); // Returns "01/01/2023 02:30 PM"
250
- * const formattedDateOnly = getFormattedLocalDateTime("2023-01-01", enAU, false, true); // Returns "01/01/2023"
251
- * const formattedInvalid = getFormattedLocalDateTime(undefined, enGB); // Returns ""
252
- * const formattedStartOfDay = getFormattedLocalDateTime(new Date(), enGB, true, false, true, undefined, true); // Returns "01/01/2023 00:00"
253
- * const formattedEndOfDay = getFormattedLocalDateTime(new Date(), enGB, true, false, true, undefined, false, true); // Returns "01/01/2023 23:59"
244
+ * const formattedDate = convertLocalDateToUTCDateTime(new Date(), enGB, true, false, true); // Returns "01/01/2023 14:30"
245
+ * const formattedDateTime = convertLocalDateToUTCDateTime("2023-01-01T14:30:00Z", enUS, true, false, false); // Returns "01/01/2023 02:30 PM"
246
+ * const formattedDateOnly = convertLocalDateToUTCDateTime("2023-01-01", enAU, false, true); // Returns "01/01/2023"
247
+ * const formattedInvalid = convertLocalDateToUTCDateTime(undefined, enGB); // Returns ""
248
+ * const outputAsStartOfDay = convertLocalDateToUTCDateTime(new Date(), enGB, true, false, true, undefined, true); // Returns "01/01/2023 00:00"
249
+ * const outputAsEndOfDay = convertLocalDateToUTCDateTime(new Date(), enGB, true, false, true, undefined, false, true); // Returns "01/01/2023 23:59"
254
250
  * ```
255
251
  */
256
- export declare const getFormattedLocalDateTime: (value?: string | Date, locale?: Locale, isUtc?: boolean, dateOnly?: boolean, show24H?: boolean, formatString?: string, formatStartOfDay?: boolean, formatEndOfDay?: boolean) => string;
252
+ export declare const convertLocalDateToUTCDateTime: (inputValue?: string | Date, locale?: Locale, outputAsStartOfDay?: boolean, outputAsEndOfDay?: boolean) => string;
257
253
  /**
258
254
  * This enum defines the types of buttons available in the dialog.
259
255
  * It is used to identify which button was clicked by the user.